Remove hardcoding #group for the status field

Created on 11 April 2024, 3 months ago
Updated 7 June 2024, 19 days ago

Problem/Motivation

When creating a custom entity, the status field can be not only a boolean type, as in node. This leads to the fact that when gin is enabled on the form for editing this entity, it looks bad.

Steps to reproduce

- Create a custom entity with a status field with a type other than boolean (for example, select)
- enable the gin edit form for the new entity
- go to the page for creating/editing an entity (see image)

Proposed resolution

configure the group only if it is a checkbox type, for example, a quick solution in GinContentFormHelper.php:

      // Assign status to gin_actions if it input is checkbox.
      $widget_type = $form['status']['widget']['#type'] ?? 'checkbox';
      if ($widget_type === 'checkbox') {
        $form['status']['#group'] = 'gin_actions';
      }

Remaining tasks

- create a mr to solve the problem
- test with different types of status field (select, entity_reference, etc.)

๐Ÿ“Œ Task
Status

Needs work

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024