[3.0] Theme split (wave 4, part 3) — fix the auto-submitting continue buttons - #9386
Open
albertlast wants to merge 1 commit into
Open
[3.0] Theme split (wave 4, part 3) — fix the auto-submitting continue buttons#9386albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
doAutoSubmit() looks the countdown field up by name, defaulting to 'cont', which is what template_not_done() calls its button. Three other pages call their button 'b' and pass 'b' along to match: the newsletter progress page, the search index progress page and the announcement progress page. They work, but only because every one of them repeats the argument. Renames those three buttons to 'cont' and drops the now redundant arguments, so all four agree with the default. Worth doing deliberately: the theme branch in 7933 renames all three buttons and leaves the 'b' argument behind, at which point the countdown silently stops appearing. The maintenance template's call had already drifted the other way. It passes no arguments at all, so it goes looking for a form named 'autoSubmit'; the installer and the upgrader name their form 'install_form' and 'upgrade_form', so the lookup fails, doAutoSubmit() logs and returns, and the step that should continue on its own waits for a click instead. It now names the form it is actually on, and does it with a function rather than a string for setTimeout() to eval. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of the split of #7933, wave 4 part 3.
doAutoSubmit()finds the countdown button by name, defaulting tocont:template_not_done()names its buttoncontand calls it with the defaults. Threeother progress pages — the newsletter, the search index and the announcement —
name theirs
band pass"autoSubmit", "b"to compensate. They work, but onlybecause every one of them remembers to repeat the argument.
This renames those three to
contand drops the redundant arguments, so all fouragree with the default.
It is worth doing deliberately rather than leaving alone, because the theme branch
renames all three buttons and leaves the
"b"argument in place. I measured whatthat combination does:
doAutoSubmit(3, 'Continue')name="cont"Continue (3)name="cont""autoSubmit", "b"(the branch)Continue— countdown lostname="b""autoSubmit", "b"(today)Continue (3)The middle row takes the
console.warn('Field "b" not found…')path. The form stillsubmits when the count runs out, so nothing breaks loudly; the countdown just stops
appearing.
The maintenance template had already drifted the other way
MaintenanceTemplate.phpcalls it with no arguments at all:so it looks for a form named
autoSubmit. There isn't one. The installer and theupgrader name their form from
Maintenance::$tool->form_id, which isinstall_formor
upgrade_form— I checked the served page, and<form id="install_form" …>isthe only form on it.
doAutoSubmit()hitsconsole.error('Form with name "autoSubmit" not found.')and returns, so the step that should continue by itselfonce its substeps finish just waits for the user to click Continue.
It now names the form it is actually on. Also passes a function to
setTimeout()rather than a string for it to eval.
Testing
The table above is real output:
doAutoSubmit()run against each markup/callcombination in the browser on this build.
For the maintenance template, the fix is against the rendered installer — its only
form is
install_form, so the old lookup could never have matched. I have notdriven a full install or upgrade to watch the countdown; the substep loop it sits
in needs one, and this is the kind of change where saying what was and was not
exercised seems more useful than implying otherwise.
Issues References (Fixes|Related|Closes)
Related to #7933