Published button is missing when using Gin theme and Gutenberg editor

Created on 28 January 2025, 2 months ago

Problem/Motivation

When using Gin admin theme and Gutenberg editor, the "Published" checkbox is missing. If using Claro theme, the "Published" checkbox re-appears.

Steps to reproduce

0. Install Drupal 10, Gin 4.0.2, and Gutenberg Editor 3.0.5
1. Install Gin admin theme
2. Install Gutenberg editor
3. Create a new content type and enable Gutenberg experience in the content type
4. Create a new content page and notice the "Published checkbox is missing."
5. Switch back to Claro admin theme and notice the "Published" checkbox reappear.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡¦πŸ‡½Γ…land Islands albertho425 Seattle, WA

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

Comments & Activities

  • Issue created by @albertho425
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    Hey lovely Gutenberg team

    Could you debug why this potentially is not showing up?

    Thank you in advance

  • πŸ‡¦πŸ‡½Γ…land Islands albertho425 Seattle, WA

    When using Gin as admin theme and Gutenberg editor in a content type in Drupal 10,

    /web/themes/contrib/gin/src/GinContentFormHelper.php Line 178 $form['status']['#group'] = 'status'; is causing the published toggle to be missing.

  • πŸ‡©πŸ‡ͺGermany marco.b

    theme_switcher to use Claro Theme at affected node forms can be used as a workaround.

  • πŸ‡©πŸ‡ͺGermany marco.b

    I overlooked that this is about version 4.0.x-dev.

    drupal/gin_gutenberg solves the problem with gutenberg 3.0.6. Has anyone tested here?

  • πŸ‡¦πŸ‡½Γ…land Islands albertho425 Seattle, WA

    I tried gutenberg 3.0.6 and the issue persists.

    I wrote a patch that comments out this entire block of code in the Gin theme and it works.

          // Only alter the status field on content forms.
          if ($is_content_form) {
            // 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.
            if ($widget_type === 'checkbox') {
              $form['status']['#group'] = 'status';
            }
          }
    
  • πŸ‡©πŸ‡ͺGermany marco.b

    @ albertho425

    > I tried gutenberg 3.0.6 and the issue persists.

    Did the issue even persist after installing drupal/gin_gutenberg? It worked for me.

    IMHO the use of a a simple contrib module seems to be better that patching, isn't it?

  • πŸ‡¦πŸ‡½Γ…land Islands albertho425 Seattle, WA

    Thank you @marco.b.

    The gin_gutenberg module works great and also resolves the issue. Had I known about this module, I wouldn't have used the patch. Thanks again!

  • πŸ‡¬πŸ‡·Greece osmnfth Grece

    @all,

    In my case i simply enabled the Gin Gutenberg: Integrate Gin theme with Gutenberg Editor because for some reason the module was not enabled.

Production build 0.71.5 2024