Published checkbox is not in top sticky bar for commerce_product forms

Created on 4 July 2024, about 1 year ago

Problem/Motivation

When adding commerce_product forms to a custom modules implementation of hook_gin_content_form_routes()
The product forms are shown with the content form layout, however the 'published' checkbox is not moved to the top sticky bar like it is for other content forms.

Steps to reproduce

Code I'm using:

function MYMODULE_gin_content_form_routes() {
  return [
    'entity.commerce_product.edit_form',
    'entity.commerce_product.add_form',
  ];
}

See screen shot for what is shown.

πŸ› Bug report
Status

Active

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

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

Comments & Activities

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

    We encountered the same issue, the following patch restores the status checkbox to the top sticky bar. Couldn't determine any undesired side effects.

  • πŸ‡©πŸ‡ͺGermany harkonn

    We also encountered the same behaviour but the patch from #3 did not help. Maybe our "fix" helps others too:

    We used $form['#tree'] = TRUE; in a hook_form_alter. After refactoring this hook to not use $form['#tree'] = TRUE; anymore the publish-field went into the gin-sticky-form-actions again.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    I am also having an issue relating to these few lines of code. I did a little debugging and checked before:

    $form['status']['#group'] = 'status';
    

    I saw that the value was 'footer'

    Now I am able to get the status checkbox to show up when I comment out the line that sets the '#group' property to 'status'. But if I leave the code as is, then the status checkbox is nowhere to be found. I am a little bit confused about the reasons behind setting the '#group' property (I see that it is not on every field), and I feel like resolving this issue sort of hinges on an understanding here. I assume that setting it to 'status' is related to the stickiness though?

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Well it looks like my issue was actually the fault of some custom template overrides. The line mentioned above turned out not to be problematic, once my overrides were updated to be more in line with gin's expectations

Production build 0.71.5 2024