Form error when no group admin role is automatically created on 3.3.x

Created on 23 August 2024, 3 months ago

Problem/Motivation

Getting warning message on creating a new group with Drupal core 10.4.x and Group 3.2.2 version. When the default role does not exist. It similar to the Group 2.x version 🐛 Form error when no group admin role is automatically created. Fixed . Verified the patch is not exist in Group 3.x version.

Steps to reproduce

  1. Create a new group type by navigating to /admin/group/types/add
  2. Under "Access settings" make sure the "Automatically configure useful default roles" and "Automatically configure an administrative role" options are unchecked.
  3. Click the "Save group type" button to save the new group type.
  4. Navigate to the edit form of the newly created group type. Example: /admin/group/types/manage/test
  5. The error message should display.

Proposed resolution

         $add_role_url = Url::fromRoute('entity.group_role.add_form', ['group_type' => $type->id()]);
         $t_args = ['@url' => $add_role_url->toString()];
         $description = $this->t('You do not have any custom group roles yet, <a href="@url">create one here</a>.', $t_args);
-        $form['access_settings']['creator_roles']['#description'] .= "<br /><em>$description</em>";
+        if (isset($form['access_settings']['creator_roles']['#description'])) {
+          $form['access_settings']['creator_roles']['#description'] .= "<br /><em>$description</em>";
+        }
       }
     }

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Needs review

Version

3.3

Component

Code

Created by

🇮🇳India arunkumark Coimbatore

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