Problem/Motivation

Originally found this when we were getting a fatal error on user learning path registration. If there is a group content entity where the actual entity has been deleted, then it tries to get the entity ID on NULL.

However looking at the function it's also loading every piece of content for the group, when groups module provides a method to get just group memberships with a certain role more efficiently.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
catch’s picture

catch’s picture

Also need to check the user referenced by the membership actually exists.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC - looks good to me and makes a lot of sense to use the membership loader instead of iterating through every user.

axelm’s picture

@catch Thanks for this patch. We will include it in the next release

axelm’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
axelm’s picture

Status: Patch (to be ported) » Fixed
axelm’s picture

Status: Fixed » Closed (fixed)