Permalink
Browse files

protect: Fix undefined variable when applying PC with other protection

Reported at WT:TW.
  • Loading branch information...
atlight committed May 26, 2015
1 parent 71f1313 commit 2716be155342e6b81ca9b4c38a2409909f33685f
Showing with 9 additions and 3 deletions.
  1. +9 −3 modules/twinkleprotect.js
View
@@ -981,6 +981,12 @@ Twinkle.protect.callback.evaluate = function twinkleprotectCallbackEvaluate(e) {
} }
}; };
var stabilizeValues = {
pclevel: form.pclevel.value,
pcexpiry: form.pcexpiry.value,
protectReason: form.protectReason.value
};
var protectIt = function twinkleprotectCallbackProtectIt(next) { var protectIt = function twinkleprotectCallbackProtectIt(next) {
thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Protecting page"); thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Protecting page");
if (mw.config.get('wgArticleId')) { if (mw.config.get('wgArticleId')) {
@@ -1017,10 +1023,10 @@ Twinkle.protect.callback.evaluate = function twinkleprotectCallbackEvaluate(e) {
} }
thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Applying pending changes protection"); thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Applying pending changes protection");
thispage.setFlaggedRevs(form.pclevel.value, form.pcexpiry.value); thispage.setFlaggedRevs(stabilizeValues.pclevel, stabilizeValues.pcexpiry);
if (form.protectReason.value) { if (stabilizeValues.protectReason) {
thispage.setEditSummary(form.protectReason.value); thispage.setEditSummary(stabilizeValues.protectReason);
} else { } else {
alert("You must enter a protect reason, which will be inscribed into the protection log."); alert("You must enter a protect reason, which will be inscribed into the protection log.");
return; return;

0 comments on commit 2716be1

Please sign in to comment.