permission_callbacks is not handled correctly

Created on 3 October 2022, over 1 year ago
Updated 2 June 2023, about 1 year ago

Problem/Motivation

in this commit, we introduce a new logic for handling custom permissions and permission_callbacks.
https://git.drupalcode.org/project/group/-/commit/9731a11215bb2475112b124f8079a3b8930ab7a7#8ec9ca2c49ac1608f35db346dba0a8f345e86c39_204_206

but unfortunately this logic doesn't work correctly and permission_callbacks stays in permission array, what is causing warnings:

Warning: Undefined array key "title" in web/modules/contrib/group/src/Access/GroupPermissionHandler.php line 183

Steps to reproduce

1) add [module_name].group.permissions.yml file to your module
2) the file should provide custom permission callback:

permission_callbacks:
  - Drupal\[module_name]\Controller\GroupPermissionsController::permissions

3) Add GroupPermissionsController and method for it

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇧🇪Belgium LOBsTerr

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇷🇴Romania Andras_Szilagyi

    I confirm the issue is still present and that the patch solved it. I got the error using gcontent_moderation, same errors when visiting the group permissions page, the patch fixed it.

  • 🇫🇮Finland ZeiP

    Works for us also. It'd be nice to get a new 1.x release for this and other issues or if the 1.x version is indeed EOL, it should be marked as unsupported to urge users to upgrade. At least for us this bug breaks the permissions view so I'm setting the priority up to major per the issue priority guidelines.

Production build 0.69.0 2024