From 85d87ac3c825a0b03c124ab51044297e55b165bd Mon Sep 17 00:00:00 2001 From: albertlast Date: Sun, 9 Aug 2026 12:23:47 +0200 Subject: [PATCH] Stops calling createEventListener, which no longer exists 588d99d63 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 Signed-off-by: albertlast --- Sources/Actions/Admin/Attachments.php | 2 -- Sources/Profile.php | 1 - Themes/default/PersonalMessage.template.php | 1 - Themes/default/scripts/register.js | 2 -- 4 files changed, 6 deletions(-) diff --git a/Sources/Actions/Admin/Attachments.php b/Sources/Actions/Admin/Attachments.php index 363ad93358d..02eaa2db260 100644 --- a/Sources/Actions/Admin/Attachments.php +++ b/Sources/Actions/Admin/Attachments.php @@ -112,9 +112,7 @@ public function attachmentSettings(): void var storing_type = document.getElementById(\'automanage_attachments\'); var base_dir = document.getElementById(\'use_subdirectories_for_attachments\'); - createEventListener(storing_type) storing_type.addEventListener("change", toggleSubDir, false); - createEventListener(base_dir) base_dir.addEventListener("change", toggleSubDir, false); toggleSubDir();'; diff --git a/Sources/Profile.php b/Sources/Profile.php index 53bf4dcf328..870573e7b28 100644 --- a/Sources/Profile.php +++ b/Sources/Profile.php @@ -1452,7 +1452,6 @@ public function setupContext(array $fields): void // Some spicy JS. Theme::addInlineJavaScript(' var form_handle = document.forms.creator; - createEventListener(form_handle); ' . (!empty(Utils::$context['require_password']) ? ' form_handle.addEventListener("submit", function(event) { diff --git a/Themes/default/PersonalMessage.template.php b/Themes/default/PersonalMessage.template.php index f6995128ec8..23ab25fa2de 100644 --- a/Themes/default/PersonalMessage.template.php +++ b/Themes/default/PersonalMessage.template.php @@ -769,7 +769,6 @@ function template_search()
diff --git a/Themes/default/scripts/register.js b/Themes/default/scripts/register.js index 95ad6417f0b..cdc60c76725 100644 --- a/Themes/default/scripts/register.js +++ b/Themes/default/scripts/register.js @@ -52,7 +52,6 @@ function smfRegister(formID, passwordDifficultyLevel, regTextStrings) // Step to it! if (eventHandler) { - createEventListener(inputHandle); inputHandle.addEventListener('keyup', eventHandler, false); eventHandler(); @@ -71,7 +70,6 @@ function smfRegister(formID, passwordDifficultyLevel, regTextStrings) var buttonHandle = document.getElementById(elementID); // Attach the event to this element. - createEventListener(buttonHandle); buttonHandle.addEventListener('click', checkUsername, false); }