- Issue created by @codebymikey
- Open on Drupal.org βEnvironment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - @codebymikey opened merge request.
- Status changed to Needs review
over 1 year ago 12:10pm 21 July 2023 12:46 11:38 Running- Status changed to Needs work
over 1 year ago 11:47pm 21 July 2023 - πΊπΈUnited States smustgrave
Tried rerunning the tests but MR doesn't seem to run.
0:39 59:47 Running0:39 58:02 Running- last update
over 1 year ago 29,877 pass - last update
over 1 year ago 29,877 pass - πΊπΈUnited States benjifisher Boston area
I think you have mis-diagnosed the problem.
On further investigation, this occurs because the User Role configuration only stores the module entries as dependencies, rather than the actual entity configs which are necessary as part of the dynamic callback.
Try assigning a permission like "create page content" to a role, then export the role to a YAML file. You will see that the role does depend on the relevant configuration. Or look at the
user.role.author.yml
file in the Umami demonstration profile.If a module creates dynamic permissions, then it should add the relevant dependencies to those permissions. There is a helper class to make this easier: see the change record Permissions can define dependencies β .
So yout problem should be fixed here: https://git.drupalcode.org/project/search_api_autocomplete/-/blob/8.x-1....
public function bySearch() { $perms = []; /** @var \Drupal\search_api_autocomplete\SearchInterface $search */ foreach ($this->storage->loadMultiple() as $id => $search) { $perms['use search_api_autocomplete for ' . $id] = [ 'title' => $this->t('Use autocomplete for the %search search', ['%search' => $search->label()]), ]; } return $perms; }
I am not sure whether to move this issue to the issue queue for
search_api_autocomplete
or close this issue (works as designed) and open a new issue for the module. - Status changed to Closed: works as designed
10 months ago 3:15am 25 January 2024 - πΊπΈUnited States benjifisher Boston area
I decided to add a new issue for the
search_api_autocomplete
module: π Define permission dependencies Needs review . I hope that others running into this problem can find this issue using their favorite search engine and then get the correct answer. - π¨π¦Canada OMD
Not sure if this is the right place to put this comment or not, but I had the same error in D10, after deleting a no longer used content type, and then many weeks later trying to adjust permissions, permission would not save, got WSOD, and the message in the log about non-existent permissions. I was able to easily replace the deleted content type, which completely fixed the error and i was able to save the permissions matrix finally. I had a few of these that had to be fixed in config when upgrading to Drupal 9 but this is the first time it has happened in Drupal 10 just for deleting a content type.
- πΊπΈUnited States dsnopek USA
Here's a new version of this patch for Drupal 10.3.