- Issue created by @anton4uk
- Status changed to Needs review
8 months ago 11:47am 14 August 2024 - 🇮🇳India Kanchan Bhogade
Hi @anton4uk
I've tried to reproduce the issue on Drupal 10 and Drupal 11,
able to see the "Save" button on the Media Directories form.
Attaching SS for referenceplease share the detailed steps to reproduce the issue
- Status changed to Needs work
8 months ago 12:25pm 20 August 2024 - Status changed to Active
8 months ago 7:49am 29 August 2024 - 🇨🇭Switzerland saschaeggi Zurich
@Kanchan Bhogade you seem to test in Claro and not Gin
Also the steps are clearly stated in the description, so moving this back to active
- 🇩🇪Germany jurgenhaas Gottmadingen
I've updated the MR in 🐛 Ensure sticky action buttons to work with modals and ajax refresh-calls Needs review with great results. Even the media directories action buttons are now visible.
However, there is an issue with the media_directories_add_form form, which is implemented as a modal over a modal. The problem is that the second level modal uses the ajax wrapper where it should be using the drupal_modal wrapper in the ajax request to receive that second form. If you have any chance to change that query argument, this should be resolved too.
Only if that doesn't work at all, a workaround would be to add the following exception at the beginning of
gin_form_alter
:// Don't unset actions for media_directories forms. if (str_contains($form['#form_id'], 'media_directories_add_form')) { return; }
However, using the correct wrapper during the request would be much preferred as this would also prevent potential other side effects in the future, not only those with Gin but also with Drupal core.
- leymannx Berlin
Added detailed steps to reproduce.
We target 4.x-dev and then backport, right?
(Unfortunately the 4.x-dev branch got misnamed 4.0.x-dev, theoretically allowing only hotfix releases. 😬)
- leymannx Berlin
If I uncomment the following piece of code in the media module, the problem we have goes away: https://git.drupalcode.org/project/drupal/-/blob/10.4.0/core/modules/med...
Media is making the
'#type' => 'submit'
to a'#type' => 'button'
and because of that it's not picked up correctly for sticky button processing at https://git.drupalcode.org/project/gin/-/blob/4.0.2/includes/form.theme?... as we only check for$button['#type'] === 'submit'
I would just allow for both types
submit
andbutton
now in the MR. - Merge request !565#3468069 Allow both types button and submit being processed into sticky actions → (Open) created by leymannx