Skip to content

Commit

Permalink
tag: Fix regression leaving generic {{merge}} instead of {{merge to}}…
Browse files Browse the repository at this point in the history
… or {{merge from}}

As reported at [WT:TW](https://en.wikipedia.org/w/index.php?oldid=918480329#Merge_tags), Twinkle has been leaving `{{merge}}` on the other page when tagging with `{{merge to}}` or `{{merge from}}` (rather than `{{merge from}}` or `{{merge to}}`, respectively).

Stems from #485, where somewhere along the way the addition in [L1274](95eac79#diff-03744d176dfd1e8a2178545886a87644R1606) at 95eac79 was removed but `params.mergeTag` remained.

I've added the line back when validating the various merge tags, since we're already evaluating them all.
  • Loading branch information
Amorymeltzer committed Sep 29, 2019
1 parent bab8522 commit f423e39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/friendlytag.js
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,8 @@ Twinkle.tag.callback.evaluate = function friendlytagCallbackEvaluate(e) {
alert('Tagging multiple articles in a merge, and starting a discussion for multiple articles, is not supported at the moment. Please turn off "tag other article", and/or clear out the "reason" box, and try again.');
return;
}
// Not strictly validation, but as long as we're here might as well be useful for later
params.mergeTag = params.tags.indexOf('Merge') !== -1 ? 'Merge' : params.tags.indexOf('Merge to') !== -1 ? 'Merge to' : params.tags.indexOf('Merge from') !== -1 ? 'Merge from' : null ;
}
if ((params.tags.indexOf('Not English') !== -1) && (params.tags.indexOf('Rough translation') !== -1)) {
alert('Please select only one of {{not English}} and {{rough translation}}.');
Expand Down

0 comments on commit f423e39

Please sign in to comment.