From c34615fdcde16d3ee33b57ad72f163c0f121cf4c Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen.haas@lakedrops.com>
Date: Thu, 19 Dec 2024 16:14:09 +0100
Subject: [PATCH] Issue #3440148 by paul121, jurgenhaas, saschaeggi: Remove
 hardcoding #group for the status field

---
 src/GinContentFormHelper.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/GinContentFormHelper.php b/src/GinContentFormHelper.php
index 1fa977bf3..006722cce 100644
--- a/src/GinContentFormHelper.php
+++ b/src/GinContentFormHelper.php
@@ -170,10 +170,12 @@ class GinContentFormHelper implements ContainerInjectionInterface {
         // Set form id to status field.
         if (isset($form['status']['widget']) && isset($form['status']['widget']['value'])) {
           $form['status']['widget']['value']['#attributes']['form'] = $form['#id'];
+          $widget_type = $form['status']['widget']['value']['#type'] ?? FALSE;
+        }
+        else {
+          $widget_type = $form['status']['widget']['#type'] ?? FALSE;
         }
-
         // Only move status to status group if it is a checkbox.
-        $widget_type = $form['status']['widget']['#type'] ?? FALSE;
         if ($widget_type === 'checkbox' && isset($form['status']['#group'])) {
           $form['status']['#group'] = 'status';
         }
-- 
GitLab