Skip to content

Commit

Permalink
Fix RM summary/log (wikimedia-gadgets#2085)
Browse files Browse the repository at this point in the history
* Fix RM summary/log

* Link to WP:RM/TR
  • Loading branch information
nardog authored and rustykitty committed Dec 1, 2024
1 parent 89a3519 commit 826f617
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions modules/twinklexfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,12 +1048,9 @@ Twinkle.xfd.callbacks = {
}
break;
case 'rm':
if (params.rmtr) {
appendText += ' (technical)';
}
if (params.newname) {
appendText += '; New name: [[:' + params.newname + ']]';
}
appendText = params.currentname
.map((currentname, i) => `# [[:${currentname}]]: ${nominatedLink} at [[WP:RM${params.rmtr ? '/TR' : ''}|]]${params.newname[i] ? `; New name: [[:${params.newname[i]}]]` : ''}`)
.join('\n');
break;

default: // afd or ffd
Expand Down Expand Up @@ -2028,9 +2025,14 @@ Twinkle.xfd.callbacks = {
rm: {
listAtTalk: function(pageobj) {
const params = pageobj.getCallbackParameters();
params.discussionpage = pageobj.getPageName();

pageobj.setAppendText('\n\n' + Twinkle.xfd.callbacks.getDiscussionWikitext('rm', params));
pageobj.setEditSummary('Proposing move' + (params.newname ? ' to [[:' + params.newname + ']]' : ''));
pageobj.setEditSummary(`Proposing move of ${
params.currentname
.map((currentname, i) => `[[:${currentname}]]${params.newname[i] ? ` to [[:${params.newname[i]}]]` : ''}`)
.join(', ')
}.`);
pageobj.setChangeTags(Twinkle.changeTags);
pageobj.setCreateOption('recreate'); // since the talk page need not exist
pageobj.setWatchlist(Twinkle.getPref('xfdWatchDiscussion'));
Expand All @@ -2053,7 +2055,7 @@ Twinkle.xfd.callbacks = {
return;
}
pageobj.setPageText(newtext);
pageobj.setEditSummary('Adding [[:' + Morebits.pageNameNorm + ']].');
pageobj.setEditSummary(`Adding [[:${params.currentname.join(']], [[:')}]].`);
pageobj.setChangeTags(Twinkle.changeTags);
pageobj.save(() => {
Twinkle.xfd.currentRationale = null; // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
Expand Down

0 comments on commit 826f617

Please sign in to comment.