Skip to content

Commit

Permalink
fluff: Fix revert coming from contribs if diffonly is used
Browse files Browse the repository at this point in the history
Fixes wikimedia-gadgets#913, same basic issue as wikimedia-gadgets#627/wikimedia-gadgets#628: if a user has "Do not show page content below diffs" selected in Special:Preferences, wgRevisionId is set to 0 on diffs.  While wikimedia-gadgets#628 took care of that for the links on diff pages themselves, trying to rollback from a contribs page was left unfixed.  Those links load the diff page then `auto`matically revert, so will run into the same issue.  This essentialy reverts back to the check before 3e5ec5b (wikimedia-gadgets#561), albeit by using `mw.util.getParamValue` rather than the no-longer-existing `Morebits.queryString.get` (wikimedia-gadgets#725).
  • Loading branch information
Amorymeltzer authored and wiki-ST47 committed Sep 2, 2020
1 parent 90569d6 commit 5b5ecfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/twinklefluff.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Twinkle.fluff.restoreThisRevision = function (element, revType) {


Twinkle.fluff.auto = function twinklefluffauto() {
if (mw.config.get('wgRevisionId') !== mw.config.get('wgCurRevisionId')) {
if (parseInt(mw.util.getParamValue('oldid'), 10) !== mw.config.get('wgCurRevisionId')) {
// not latest revision
alert("Can't rollback, page has changed in the meantime.");
return;
Expand Down

0 comments on commit 5b5ecfb

Please sign in to comment.