Add configuration option for default group status

Created on 7 March 2025, about 1 month ago

Problem/Motivation

Currently, the Group module creates new groups as published by default. This makes it difficult for sites that need to implement a moderation workflow where groups should be unpublished until reviewed.

Proposed resolution

Add a configuration option to the group type settings that allows administrators to set whether new groups of that type should be published or unpublished by default.

Technical details:
1. Add a new `default_status` property to the GroupType entity
2. Add getter/setter methods in GroupTypeInterface
3. Add a checkbox in the group type form
4. Modify the Group entity's preCreate() method to set the status based on the group type setting
5. Add the new property to the config_export section

Benefits:
- Allows sites to implement proper moderation workflows for groups
- Maintains backward compatibility (defaults to published)
- Follows Drupal's pattern of configurable default status (similar to nodes)
- No impact on existing groups or group types

Implementation approach:
1. Add the property and methods to GroupType entity
2. Add the form field in GroupTypeForm
3. Update the Group entity to respect this setting
4. Add tests to verify the behavior

Feature request
Status

Active

Version

3.3

Component

Code

Created by

🇧🇪Belgium arwillame Belgium 🇧🇪

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

Merge Requests

Comments & Activities

  • Issue created by @arwillame
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 1186s
    #442858
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 217s
    #442885
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 517s
    #442888
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 279s
    #442895
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 409s
    #442904
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1352s
    #442913
  • Pipeline finished with Failed
    30 days ago
    Total: 1216s
    #444513
  • Pipeline finished with Failed
    30 days ago
    Total: 1192s
    #444536
  • 🇧🇪Belgium tim-diels Belgium 🇧🇪
Production build 0.71.5 2024