Fix Adding non-existent permissions to a role is not allowed in Drupal 10 issue. The incorrect permission for search content

Created on 22 February 2023, over 1 year ago
Updated 30 May 2023, about 1 year ago

Problem/Motivation

Tested to do the following to Allow all users to use search

 // Allow all users to use search.
  user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['search content']);
  user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['search content']);

But I keep getting
RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "search content".

Not sure if the timing in the .insall is right for this.

Proposed resolution

Have the following in the varbase_search.info.yml file

dependencies: [ ]
install:
  - search
  - search_api
  - search_api_db

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-10.0.0-alpha1 , varbase_search-10.0.0-alpha1

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3343821 : Fixed Adding non-existent permissions to a role is not allowed in Drupal 10 issue. The incorrect permission for search content
📌 Task
Status

Fixed

Version

10.0

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024