Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
\Drupal\Core\Render\Element\Button::preRenderButton
allows to explicitly remove .form-submit
. Markup purists could then theoretically do it.
For various reasons (e.g. #2831459: page_load_progress doesn't respect form validation) we want to either only support .form-submit
or add a new class we'll know is going to be there always.
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-6-12.txt | 517 bytes | anavarre |
#12 | 2883036-12.patch | 8.25 KB | anavarre |
| |||
#7 | 2883036-6.patch | 8.11 KB | anavarre |
#6 | interdiff-5-6.txt | 1.3 KB | anavarre |
#5 | interdiff-4-5.txt | 1.14 KB | anavarre |
Comments
Comment #2
anavarreIn case we decide to go with
.form-submit
, here's a PoC that looks to be working okay.Comment #3
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedI understand that markup purist *could* remove submit-form class, ending up with a not anymore working module. Those *power users* need some skills to do so, and would have thus also the skill to create a custom submodule (or theme) running a specific hook. For this reason and to keep some flexibility to power users, I would suggest the following:
Keep a configuration this kind.
Do not hardcode here, but keep using the configuration.
Keep using the loop over the configuration.
Keep this thus !
Indeed, do not let configuration this kind via admin UI.
Instead, add up a configuration to exclude some form via there form_id (similarly to IFE module). Potentially using wildcarded form IDs.
NOTES:
Hopefully my english is clear enough so theses explanations can be understandable :)
Comment #4
anavarreAttached patch is the result of a coding session / brainstorming with Dom. - No interdiff since this is a completely different approach. The idea here is we're trying to be as flexible as can be by adding a new CSS class
.page-load-progress-submit
which allows us to not rely on core's.form-submit
anymore. The critical point here is we're no longer triggering a throbber for Ajax-based forms. This will help with fixing issues such as #2823968: Entity browser issue.Another issue that should be fixed now is HTML 5 validation that was causing troubles in #2831459: page_load_progress doesn't respect form validation. This has been made possible by using
.parents('form').submit(function () ... );
in the JS file.Unrelated to this issue, we've also made sure to bring consistency to the module by removing any occurrence to 'spinner' and use 'throbber' instead. In the same vein, we've dropped using the confusing JS variable name
exit_elements
and have settled onelements
instead.Comment #5
anavarreComment #6
anavarreNow with an additional test.
Comment #7
anavarreComment #8
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedApart for the following glitch, seems fine to me as long as this seems functionally ok too (just read through the code, did not actually applied the patch).
Why remove this line ?
Comment #9
anavarreIt's not actually being removed.
If you could try and apply the patch and click around that'd be great so that you can then RTBC. On my end it works perfectly and I closed the HTML 5 validation / Entity browser issues because this does solve both problems.
Comment #10
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedSorry did not see it ! Indeed
Comment #11
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedWhen applying:
2883036-6.patch:92: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Beside this ok: RTBC
Comment #12
anavarreOkay. This should apply better.
Comment #13
anavarreCredited Dom.
Comment #15
anavarreFixed, thanks!
Comment #17
jomarocas CreditAttribution: jomarocas commentedpackport for drupal 7?
Comment #18
anavarreSorry, no. The D7 branch is bug fix only.