Group content form id

Created on 12 July 2023, over 1 year ago

Problem/Motivation

Because group follow it is a specific way of handling machine names (they contain dashes) , it is impossible to target a specific form id with a hook and quite often we have to use a general form_alter hook, which is called for every form and this is a bad practice due to performance.

Steps to reproduce

Try to hook any group content form, in our case for exmaple we get something like this "group_content_group_type-group_membership_delete_form"

Proposed resolution

My suggestion to override getFormId for GroupContent entity class and replace all dashes to make it this Form Id suitable for php functions.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇪Belgium lobsterr

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

Comments & Activities

  • Issue created by @lobsterr
  • @lobsterr opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇧🇪Belgium lobsterr

    I think, it would also nice to have base classes for Group content form and Group content form confirmation. This way we are sure that form id is correctly handled. Submodules can use it.

Production build 0.71.5 2024