Page MenuHomePhabricator

[Regression] window.ProtectionForm is not defined
Closed, ResolvedPublic

Description

Happens on ?action=protect on translatewiki.net


Version: 1.20.x
Severity: blocker

Details

Reference
bz33660
ReferenceSource BranchDest BranchAuthorTitle
repos/mwbot-rs/rust-ci-pipeline!12use-memory-optimized-runnermainmirrorktuse memory-optimized runner
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 12:07 AM
bzimport set Reference to bz33660.

Caused by a race condition. Inline code does not properly wait the module:

<select id="mwProtectExpirySelection-edit" name="wpProtectExpirySelection-edit" onchange="ProtectionForm.updateExpiryList(this)"
<!-- /footer -->
<script>
if(window.mw){
mw.loader.load([..., "mediawiki.legacy.protect", ..]);
}
</script>
<script>
if(window.mw){
ProtectionForm.init({"tableId": "mwProtectSet", "labelText": "Unlock further protect options", "numTypes": 2, "existingMatch": true});
}
</script>

Both the inline onchange handler and the init() call on the bottom are called before the module is loaded.

On the long term bug 33871 is the right solution. On the short solution we should add this module to the top-queue instead of the bottom queue, so that it is available throughout the page.