- ๐ฌ๐งUnited Kingdom darren.fisher
Is this the same issue as:
https://www.drupal.org/project/nodeaccess/issues/3509391 ๐ฌ Upgrade to version 2 deletes existing permissions ActiveIf so we should also mark one of these as closed (duplicate).
- ๐ฌ๐งUnited Kingdom darren.fisher
nodeaccess.settings.yml 1.x
grants: view: 1 edit: 1 delete: 1 priority: 0 preserve: 1
nodeaccess.settings.yml 2.x
allowed_grant_operations: grant_view: true grant_update: true grant_delete: true bundles_roles_grants: {} grants_tab_availability: {} map_rid_gid: {} roles_settings: {}
There is an update hook provided in nodeaccess.install:
https://git.drupalcode.org/project/nodeaccess/-/blob/2.0.x/nodeaccess.in.../** * Migrates nodeaccess.settings. */ function nodeaccess_update_9002(&$sandbox) { $config = \Drupal::configFactory()->getEditable('nodeaccess.settings'); // From grants to allowed_grant_operations. $old_grants = $config->get('grants'); $config ->set('allowed_grant_operations', [ 'grant_view' => (boolean) $old_grants['view'], 'grant_update' => (boolean) $old_grants['edit'], 'grant_delete' => (boolean) $old_grants['delete'], ]) ->clear('grants'); // From allowed_types to grants_tab_availability. $old_allowed_types = $config->get('allowed_types') ?? []; $grants_tab_availability = []; foreach ($old_allowed_types as $bundle => $value) { $grants_tab_availability[$bundle] = (boolean) $value; } $config ->set('grants_tab_availability', $grants_tab_availability) ->clear('allowed_types'); // From role_map to map_rid_gid. $old_role_map = $config->get('role_map'); $config ->set('map_rid_gid', $old_role_map) ->clear('role_map'); // From role_alias to roles_settings. $old_role_alias = $config->get('role_alias'); $roles_settings = []; foreach ($old_role_alias as $role_id => $value) { $roles_settings[$role_id] = [ 'display_name' => $value['alias'], 'name' => $value['name'], 'weight' => (int) $value['weight'], 'selected' => (boolean) $value['allow'], ]; } $config ->set('roles_settings', $roles_settings) ->clear('role_alias'); $bundles = array_keys($old_allowed_types); $bundles_roles_grants = []; foreach ($bundles as $bundle) { $old_bundle_settings = $config->get($bundle); foreach ($old_bundle_settings as $role_id => $grant) { $bundles_roles_grants[$bundle][$role_id] = [ 'grant_view' => (int) $grant['grant_view'], 'grant_update' => (int) $grant['grant_update'], 'grant_delete' => (int) $grant['grant_delete'], ]; } $config->clear($bundle); } $config ->set('bundles_roles_grants', $bundles_roles_grants) ->clear('priority') ->clear('preserve') ->save(); }
Did you run
drush updb
/drush updatedb
anddrush cr
/drush cache:rebuild
?Please let me know and I can investigate this further if you're still having issues?