Error when after creating a tree when no group roles have been set up yet

Created on 14 August 2023, about 1 year ago
Updated 8 December 2023, 10 months ago

Problem/Motivation

If you create a subgroup tree before having configured at least one inheritable role on each group type involved an error is thrown after saving the tree:

TypeError: Unsupported operand types: array + null

This is because in that case the #options for the select fields on the role inheritance configuration form are NULL instead of an empty array.

Marked this is a minor as in a normal workflow one would set up the group roles first before creating the subgroup tree.

Steps to reproduce

- Install Drupal 9 or newer
- Install the Group module
- Install the Subgroup module
- Create two group types but do not configure any group roles yet
- Create a subgroup tree

Proposed resolution

Initialize the #options as an empty array.

Remaining tasks

- Create MR
- Review MR
- Merge MR

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇱Netherlands ricovandevin

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024