[3.0] Stop calling createEventListener, which no longer exists - #9439
Open
albertlast wants to merge 1 commit into
Open
[3.0] Stop calling createEventListener, which no longer exists#9439albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
588d99d took the createEventListener() shim out of script.js and left five calls to it behind. Each one throws a ReferenceError, and since they all sit at the top of an inline block, everything after them in that block is skipped: - Profile.php never reaches the submit handler that stops an account being saved without the current password, so that alert never appears. - The attachment settings page never binds or runs toggleSubDir(), so the base directory and "use subdirectories" rows show even when attachment directories are not managed automatically. - The PM search page never binds initSearch(), which unescapes a %u sequence pasted into the search box. - register.js throws inside addVerificationField() and addUsernameSearchTrigger(), which is every live check on the sign-up form. The shim only existed for browsers without addEventListener, so there is nothing to put back; the calls go. Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
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
588d99d63("Remove string evaluations") took thecreateEventListener()shim out ofscript.jsand left five calls to it behind. Nothing defines it any more:Each call sits at the top of an inline block, so everything after it in that block is
skipped as well. Four pages are affected.
Sources/Profile.php:1455Sources/Actions/Admin/Attachments.php:115,117toggleSubDir()is never bound and never run, so the base-directory and "use subdirectories" rows show whatever the automatically manage attachment directories setting saysThemes/default/PersonalMessage.template.php:772initSearch()is never bound, so a%usequence pasted into the PM search box stays escapedThemes/default/scripts/register.js:55,74addVerificationField()andaddUsernameSearchTrigger(), which is every live check on the sign-up formThe shim only ever existed for browsers with no
addEventListener— 2.1's copy is theattachEventfallback — so there is nothing to put back. The calls go.Checked
Admin → Attachments and Avatars, with automatic management off:
use_subdirectories_for_attachmentsdisplay: nonebasedirectory_for_attachmentsand its rowand switching automatically manage on brings all four back, off hides them again.
Profile → Account Settings with the password field empty: submitting is now cancelled
with "For security reasons, your current password is required to make changes to your
account." On
release-3.0the event is not cancelled and no alert is raised.The console error is gone from all three pages I could reach. The sign-up form is read from
the code rather than exercised — registration is off on this install — but it is the same
ReferenceErrorfrom a function that runs for everyautovfield on the form.Issues References (Fixes|Related|Closes)
n/a