Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing configuration that enables modules (in this case guides) can cause permissions not exists error #237

Open
ekes opened this issue Jul 29, 2024 · 1 comment

Comments

@ekes
Copy link
Member

ekes commented Jul 29, 2024

  Adding non-existent permissions to a role is not allowed. The incorrect permissions are "create local 
  gov_guides_overview content", "create localgov_guides_page content", "delete any localgov_guides_over
  view content", "delete any localgov_guides_page content", "delete localgov_guides_overview revisions"
  , "delete localgov_guides_page revisions", "delete own localgov_guides_overview content", "delete own   
   localgov_guides_page content", "edit any localgov_guides_overview content", "edit any localgov_guide
  s_page content", "edit own localgov_guides_overview content", "edit own localgov_guides_page content"
  , "revert localgov_guides_overview revisions", "revert localgov_guides_page revisions", "view localgo
  v_guides_overview revisions", "view localgov_guides_page revisions".

This is because the permission required are not loaded from a file but calculated.
https://git.drupalcode.org/project/drupal/-/blob/0fd4bdcb16ca339c06e0eb6a8b30a4b13a810793/core/modules/node/src/NodePermissions.php#L24
return $this->generatePermissions(NodeType::loadMultiple(), [$this, 'buildPermissions']);. Specifically
NodeType::loadMultiple() isn't returning the newly installed modules. I guess it's cached, and it's all in the same drush cim, so not getting updated.

@ekes
Copy link
Member Author

ekes commented Jul 29, 2024

Except putting a drupal_flush_all_caches or \Drupal::entityTypeManager()->getStorage('node_type')->resetCache() doesn't do it.

I think maybe the module is now enabled; but the configuration node.type.· has not yet been imported :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant