Problem/Motivation

#3483599: Convert all procedural hook implementations to Hook classes moved the field_ui_entity_operation function to an OOP implementation, resulting in the following fatal on the group content page (e.g. /admin/group/types/manage/lorem/content) when using Drupal core 11.1.0.

Error: Call to undefined function Drupal\group\Plugin\Group\RelationHandlerDefault\field_ui_entity_operation() in Drupal\group\Plugin\Group\RelationHandlerDefault\OperationProvider->getOperations() (line 78 of modules/contrib/group/src/Plugin/Group/RelationHandlerDefault/OperationProvider.php). 

Issue fork group-3494447

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

arkener created an issue. See original summary.

kristiaanvandeneynde made their first commit to this issue’s fork.

kristiaanvandeneynde’s picture

Status: Active » Needs review

Added a MR that calls the module handler. This should make it work on both pre and post 11.1 Drupal.

arkener’s picture

Status: Needs review » Needs work

Thanks for your quick reaction Kristiaan! I've tested this patch on 11.1.0 and I'm now receiving an Unsupported operand types: array + null error:

Stacktrace:

  at /var/www/html/drupal/modules/contrib/group/src/Plugin/Group/RelationHandlerDefault/OperationProvider.php:78
  at Drupal\group\Plugin\Group\RelationHandlerDefault\OperationProvider->getOperations()
     (/var/www/html/drupal/modules/contrib/group/src/Plugin/Group/RelationHandler/OperationProviderTrait.php:62)
  at Drupal\group\Plugin\Group\RelationHandler\EmptyOperationProvider->getOperations()
     (/var/www/html/drupal/modules/contrib/group/src/Entity/Controller/GroupTypeController.php:202)
...

Adding a simple fallback for no invokes ?? [] on OperationProvider.php:78 fixed this issue for me.

simohell’s picture

I have the same behavior (array+null with the patch), so following the issue.

sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Working on it.

sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned
Status: Needs work » Needs review
simohell’s picture

Status: Needs review » Reviewed & tested by the community

I tested the latest version of the MR with 11.0.10-dev and 11.1.1-dev and both worked.
A patched version also worked on the site where I encountered the issue in a real life situation on 11.1.0, so I would say the MR fixes the issue described in the summary.

arkener’s picture

Tested the latest version of the MR on my instance of 11.1.0 and it also resolved the Unsupported operand types: array + null issue for me.

jasonsafro’s picture

I encountered this problem with Drupal 11.1.1 and Group 3.3.3. The patch worked for me too.

jerrac’s picture

Patch worked for me on Group 3.3.4 and Drupal 11.1.3.

ikam’s picture

Patch also worked for me on Group 3.3.0 and Drupal Core 11.1.3

sanderwind’s picture

Status: Reviewed & tested by the community » Needs work

The patch can be applied successfully, but does not fix implementing the entity_operation hook of the Field UI module. It is calling the hook with a trailing s, but that specific hook does not exist

I'll fix the invocation of the hook.

sanderwind’s picture

Status: Needs work » Needs review
sdhruvi5142’s picture

Assigned: Unassigned » sdhruvi5142
sdhruvi5142’s picture

StatusFileSize
new646.08 KB
new682.68 KB

Hi, Applied the MR!204 on Drupal 11.1.4 version and it is working as expected.

Testing Steps:
1. Installed group module
2. Go to /admin/group/types/manage/testing/content path
3. Oberve the changes there

Testing result:
Before applying patch I was able to see the error and after applying the patch the errors are removed able to see the page properly. Attaching the screenshots for reference. Moving this issue to RTBC+1

Status - PASS

sdhruvi5142’s picture

Status: Needs review » Reviewed & tested by the community
makbay’s picture

Patch works. Thanks!

tormi’s picture

StatusFileSize
new3.24 KB

RTBC. Saving MR as a patch to use it safely in Composer. Source https://www.drupal.org/project/group/issues/3494447#comment-16041712

jlbellido’s picture

I do confirm that MR!204 works for me as well like a charm.
Thanks!

tvalimaa’s picture

Patch worked on /admin/group/types/manage/group/content page and also i had problems with saving a new groups which this also seems to solved. I didn't get any errors on saving a new group but those just didn't save but after this patch everything seems to work.

kristiaanvandeneynde’s picture

Assigned: sdhruvi5142 » Unassigned

Will do final check and commit on Friday probably, maybe early next week.

dabbor’s picture

I needed to fix on Group 2.3.x so I created a port of the issue and manually applied the fix there: https://www.drupal.org/project/group/issues/3522375

kristiaanvandeneynde’s picture

Generally, the approach is to commit to the target branch first and then the other active branches, in the same issue. Please don't open new issues for porting MRs as it makes my huge issue queue even larger.

kristiaanvandeneynde’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.