Skip to content

Commit

Permalink
Merge pull request #1093 from Amorymeltzer/xfd-noreasonsillyerrors
Browse files Browse the repository at this point in the history
xfd: Don't show reason for AfD errors that don't matter
  • Loading branch information
Amorymeltzer committed Sep 2, 2020
2 parents 9f6d51f + 7a450cb commit e62c613
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions modules/twinklexfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,12 +969,7 @@ Twinkle.xfd.callbacks = {

// Now we know we want to go ahead with it, trigger the other AJAX requests

// Mark the page as curated/patrolled, if wanted
if (Twinkle.getPref('markXfdPagesAsPatrolled')) {
pageobj.triage();
}

// Starting discussion page
// Start discussion page, will also handle pagetriage and delsort listings
var wikipedia_page = new Morebits.wiki.page(params.discussionpage, 'Creating article deletion discussion page');
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.afd.discussionPage);
Expand All @@ -997,16 +992,6 @@ Twinkle.xfd.callbacks = {
Twinkle.xfd.callbacks.addToLog(params, null);
}

// List at deletion sorting pages
if (params.delsortCats) {
params.delsortCats.forEach(function (cat) {
var delsortPage = new Morebits.wiki.page('Wikipedia:WikiProject Deletion sorting/' + cat, 'Adding to list of ' + cat + '-related deletion discussions');
delsortPage.setFollowRedirect(true); // In case a category gets renamed
delsortPage.setCallbackParameters({discussionPage: params.discussionpage});
delsortPage.load(Twinkle.xfd.callbacks.afd.delsortListing);
});
}

// Remove some tags that should always be removed on AfD.
text = text.replace(/\{\{\s*(dated prod|dated prod blp|Prod blp\/dated|Proposed deletion\/dated|prod2|Proposed deletion endorsed|Userspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, '');
// Then, test if there are speedy deletion-related templates on the article.
Expand Down Expand Up @@ -1038,6 +1023,22 @@ Twinkle.xfd.callbacks = {
pageobj.setCreateOption('createonly');
pageobj.save(function() {
Twinkle.xfd.currentRationale = null; // any errors from now on do not need to print the rationale, as it is safely saved on-wiki

// Actions that should wait on the discussion page actually being created
// and whose errors shouldn't output the user rationale
// List at deletion sorting pages
if (params.delsortCats) {
params.delsortCats.forEach(function (cat) {
var delsortPage = new Morebits.wiki.page('Wikipedia:WikiProject Deletion sorting/' + cat, 'Adding to list of ' + cat + '-related deletion discussions');
delsortPage.setFollowRedirect(true); // In case a category gets renamed
delsortPage.setCallbackParameters({discussionPage: params.discussionpage});
delsortPage.load(Twinkle.xfd.callbacks.afd.delsortListing);
});
}
// Mark the page as curated/patrolled, if wanted
if (Twinkle.getPref('markXfdPagesAsPatrolled')) {
pageobj.triage();
}
});
},
todaysList: function(pageobj) {
Expand Down

0 comments on commit e62c613

Please sign in to comment.