TypeError: Drupal\group\Plugin\GroupContentEnablerBase::createAccess(): Argument #1 ($group) must be of type Drupal\group\Entity\GroupInterface, null given

Created on 11 July 2023, 12 months ago

Problem/Motivation

TypeError: Drupal\group\Plugin\GroupContentEnablerBase::createAccess(): Argument #1 ($group) must be of type Drupal\group\Entity\GroupInterface, null given, called in /code/web/modules/contrib/group/src/Entity/Access/GroupContentAccessControlHandler.php on line 31 in Drupal\group\Plugin\GroupContentEnablerBase->createAccess() (line 297 of /code/web/modules/contrib/group/src/Plugin/GroupContentEnablerBase.php)

Proposed resolution

  • Add a check if the group key exists on $context array so that it will not return a null value.
  • Return a AccessResult::neutral() value if the group do not exist in context.
πŸ› Bug report
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡΅πŸ‡­Philippines Johnzel Tuddao

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024