We are using the same voodoo Comment does to make the 'entity_id' field on GroupContent able to reference all sorts of content entities. The problem is that during the first save of a Group, when a membership gets created, the schema/field definitions don't know that it should reference a user and tries to load a node instead.

On some occasions this crashes the site, so I'll revert the code that triggers this while we work on a fix. This warrants an alpha 5 release.

CommentFileSizeAuthor
#6 group-2734105-6.patch2.73 KBkristiaanvandeneynde

Comments

kristiaanvandeneynde created an issue. See original summary.

silkogelman’s picture

Could this be the same issue as this:

Problem

Fatal error when adding a Group for first time.

Fatal error: Call to a member function label() on a non-object in /***/sites/default/modules/group/src/Plugin/GroupContentEnablerBase.php on line 129

Occurs at least with these Drupal versions:
8.0.7-dev (the one simplytest.me is currently installing by default)
8.1.1 (local Acquia Dev Desktop)
The same fatal error in both cases, haven't tested other Drupal versions yet.

To replicate

Install Group in a fresh Drupal environment
for example https://simplytest.me/project/group

enable modules:

  • Group
  • Group Node

Rebuild permissions

Create a group type
Create a group of the type you created

Workaround solution

not completely sure about this yet, but clearing cache at some point after rebuilding permissions seems to help.

Update: testing patch (revert code), will report results

silkogelman’s picture

Tested 8.x-1.0-alpha5: no more #3, woot :)

Tested in these cases:
8.x-1.0-alpha5 in core 8.0.7-dev
8.x-1.0-alpha5 in core 8.1.1

I'm following this issue: happy to test the permanent fix too.

kristiaanvandeneynde’s picture

Thanks! I've tracked down the issue, but I can't find out how it's happening yet. Stay tuned!

kristiaanvandeneynde’s picture

Status: Active » Needs review
StatusFileSize
new2.73 KB

Well, that took forever to debug. This is also broken in comment.module in core seeing as Group copied that logic from there so I'll post an issue about it.

silkogelman’s picture

Version: 8.x-1.0-alpha4 » 8.x-1.0-alpha5

Seems to work!
Caution: I only tested if this works from the (backend) UI perspective.
(Code perspective testing is not my expertise)

as alpha5 also works, there is no difference seen in UI (errors) with and without the #6 patch.
In both cases the fatal error from #3 is not occurring anymore. (the alpha4 error)

Tested in these cases:
8.x-1.0-alpha5 in core 8.0.7-dev (simplytest.me)
8.x-1.0-alpha5 in core 8.1.1 (local dev)

Patch applied cleanly in both cases, no visible errors seen at Drupal backend UI

kristiaanvandeneynde’s picture

Status: Needs review » Fixed

Right, that warrants another release then. Marking this as fixed until the core issue in the Comment queue gets some love and we can copy that fix into Group. Thanks for testing this!

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs work

The last submitted patch, 6: group-2734105-6.patch, failed testing.

kristiaanvandeneynde’s picture

Status: Needs work » Closed (fixed)

Bad testbot! :)