Skip to content
Snippets Groups Projects
Commit ef8cd85e authored by Qiangjun Ran's avatar Qiangjun Ran
Browse files

Revert "Issue #3317718 by jungle: Empty nodeaccess_update_8101()"

This reverts commit 689ccc5d.
parent 43122bbc
Branches
Tags
1 merge request!11Issue #3408893 by BenStallings: Explain how to find which gids go with which user roles.
......@@ -106,7 +106,22 @@ function nodeaccess_schema() {
* Update nodeaccess allowed role settings.
*/
function nodeaccess_update_8101() {
// Emptied as the original code does not make sense anymore.
// @todo A new nodeaccess_update_N implementation to support users upgrading
// to the 2.0.x branch.
$config = \Drupal::configFactory()->getEditable('nodeaccess.settings');
$role_alias = $config->get('role_alias');
foreach (user_roles() as $id => $role) {
if ($role_alias[$id]) {
$role_alias[$id]['alias'] = $role->label();
$role_alias[$id]['name'] = $role->label();
}
else {
$role_alias[$id] = [
'alias' => $role->label(),
'name' => $role->label(),
'weight' => 0,
'allow' => 0,
];
}
}
$config->set('role_alias', $role_alias);
$config->save();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment