Support for Removing Multiple Groups Per Entity

Created on 8 November 2022, about 2 years ago
Updated 24 February 2023, almost 2 years ago

Problem/Motivation

After creating a widget that removes multiple groups per entity, there was an issue when postSave was executed. It will delete the first group_content_entity, which invokes GroupContent to save. Inside of a hook_update, it saves the entity thus triggering entitygroupfield::postSave again. When it is invoked this time, the group_content_entity has already been deleted but there is still a reference in the iterator.

Steps to reproduce

1. Create an entity that can have multiple groups.
2. Add multiple groups to that entity.
3. Remove multiple groups from that entity.

Proposed resolution

This is a basic check to ensure the entity is still set on the group_content before attempting to access it.

✨ Feature request
Status

Needs work

Version

1.0

Component

Widgets

Created by

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    The explanation basically makes sense, but I wouldn't want to commit this without test coverage. If you'd like to see this happen, please provide tests.

    Thanks!
    -Derek

Production build 0.71.5 2024