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

Issue fork group-3313220

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

LOBsTerr created an issue. See original summary.

lobsterr’s picture

Assigned: lobsterr » Unassigned
Status: Active » Needs review
jeslin.shaji’s picture

I got the same warning in a View where I had configured access using Group permission. The changes mentioned by @LOBsTerr fixed the issue.

lobsterr’s picture

Issue summary: View changes
kristiaanvandeneynde’s picture

This is fixed in 2 and 3, but not in 1 which is EOL. Not sure how to proceed, I've added tests for this to the 2 and 3 branch just now.

lobsterr’s picture

According to statistics, it is still alive 12 000 downloads! I can propose to collect the tickets like this, which can be easily fixed and I hope we still have a small releases :)

kristiaanvandeneynde’s picture

If you can help out with that, sure. The reason it's EOL is because the API between v1 and v2/3 differs greatly and it's a nightmare to deliver new features on v1 using the old API. So I have to dedicate what resources I have to v2/3.

Having said that, I do expect people to at least upgrade to v2 when it's out of beta.

lobsterr’s picture

You don't have to explain me about support hell. I am currently maintain 5 modules group related and for all of them has two versions :)
The only module, which works for both versions is group_permissions!

andras_szilagyi’s picture

Status: Needs review » Reviewed & tested by the community

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.

zeip’s picture

Priority: Normal » Major

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.