Happens on ?action=protect on translatewiki.net
Version: 1.20.x
Severity: blocker
Happens on ?action=protect on translatewiki.net
Version: 1.20.x
Severity: blocker
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T33217 MediaWiki bugs to be fixed for 1.19wmf1 deployment (tracking) | |||
Resolved | Krinkle | T35660 [Regression] window.ProtectionForm is not defined |
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.