- Issue created by @isalmanhaider
- 🇵🇰Pakistan isalmanhaider
Interesting — after switching the admin theme from Gin to Claro, the form submission started working as expected.
This suggests the issue is likely related to Gin, which helps narrow down the scope for further investigation. - 🇦🇺Australia pameeela
I think this is at least major, maybe even critical, because there is no workaround that I can see.
Clicked around to see whether there were any other forms affected but didn't find any.
- 🇩🇪Germany jurgenhaas Gottmadingen
The sticky buttons in that form have the
data-drupal-selector="edit-save-continue"
attribute, but that should bedata-drupal-selector="gin-sticky-edit-save-continue"
. I'll investigate how that's happening. - 🇩🇪Germany jurgenhaas Gottmadingen
This is an interesting one. Looking into the 4 entity type forms from core
'node_type_add_form', 'comment_type_add_form', 'media_type_add_form', 'block_content_type_add_form',
they're all built similarly, but only the media type form behaves differently; the other 3 work as expected. This is because this media type create form wants to support browsers with disabled javascript. Therefore, those buttons are changed from type
submit
into typebutton
. But Gin currently only treats submit type buttons as sticky buttons with the special treatment in the top bar. And that's important that way, as regular buttons usually have a different behavior and don't submit a form.The relevant code in core which is responsible for this can be found at
\Drupal\media\MediaTypeForm::actions
with a comment that explains what's going on.I'm uncertain how we should resolve this, TBH. The related Drupal core issue is #3018539: Media types cannot be created in the UI without JavaScript → and it's in core since 8.6 in 2018. It probably never occurred to anyone before, as creating new media types through the UI is probably the least that most site builders ever do.
What are our options?
- Treating all buttons as sticky submit button? Maybe comes with unexpected side-effects.
- Adding special treatment in Gin just for this form
- Revisiting the core approach of handling this
- other options?
- 🇺🇸United States phenaproxima Massachusetts
Does anyone disable JavaScript in 2025?
I kinda lean towards assuming you have JavaScript on, and if you don't, then you can't be creating a media type in the UI.
- 🇩🇪Germany jurgenhaas Gottmadingen
I'm with you. That would require a change in core, though.
- 🇦🇺Australia pameeela
Inclined to think we need special handling in Gin for now, because the core change is not likely to be that quick. We are not sure if there is an official policy but the understanding is that it should be usable with JS disabled, and seems like it was not before this change. Reworking the approach in core is certainly worthwhile, but I think our best bet is the one that can be done fastest.
Considering this is the only form with the ajax consideration, it should be the only one that needs special handling?
- 🇩🇪Germany jurgenhaas Gottmadingen
I guess so. It'll be ugly, but it'll work. Of no objection comes up before than, I'll fix it tomorrow.
- Merge request !637Issue #3534385 by pameeela, isalmanhaider, jurgenhaas, phenaproxima: Unable to... → (Merged) created by jurgenhaas
- 🇮🇳India sandip
I have reproduced the issue and after applying the MR it fixes the issue. Attaching a gif for better understanding.
-
jurgenhaas →
committed 22260e05 on 5.0.x
Issue #3534385 by jurgenhaas, pameeela, sandip, isalmanhaider,...
-
jurgenhaas →
committed 22260e05 on 5.0.x
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇺🇸United States kmonty San Francisco, CA & Berlin, DE
Suggesting this be re-opened to backport the fix to 4.1.x, as this impacting Drupal 10.5 as well.