Skip to content

Commit

Permalink
fix for WPBS 中包含 {{WikiProject}
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Nov 14, 2024
1 parent 03079bf commit 29d5a92
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions routine/20200122.update_vital_articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ node 20200122.update_vital_articles.js use_language=en skip_vital "do_PIQA=Talk:
node 20200122.update_vital_articles.js use_language=en skip_vital "do_PIQA=Talk:Tyasha Harris"
node 20200122.update_vital_articles.js use_language=en skip_vital "do_PIQA=Talk:Paula Dockery|Talk:Abebe Bikila"
node 20200122.update_vital_articles.js use_language=en skip_vital "do_PIQA=Talk:Tom Hales (Irish republican)"
node 20200122.update_vital_articles.js use_language=en skip_vital "do_PIQA=Talk:Cor van Aanholt"
node 20200122.update_vital_articles.js use_language=zh
node 20200122.update_vital_articles.js use_language=zh do_PIQA=1000000 forced_edit
Expand Down Expand Up @@ -128,6 +129,8 @@ const listed_article_info = Object.create(null);
const have_to_edit_its_talk_page = Object.create(null);

const WPBS_syntax_error_pages = [];
// page_title => Template:WikiProject
const non_WikiProject_in_WPBS = new Map();

const template_name_hash = {
WPBS: 'WikiProject banner shell',
Expand Down Expand Up @@ -875,8 +878,8 @@ async function do_PIQA_operation() {
no_topic_message: true,
do_PIQA: true,
key_is_talk_page: true,
category_to_clean,
no_class_detected: category_to_clean === 'Category:Pages using WikiProject banner shell without a project-independent quality rating',
category_to_clean: !Array.isArray(do_PIQA) && category_to_clean,
no_class_detected: !Array.isArray(do_PIQA) && category_to_clean === 'Category:Pages using WikiProject banner shell without a project-independent quality rating',
};
}

Expand Down Expand Up @@ -919,7 +922,7 @@ async function do_PIQA_operation() {
bot: 1,
nocreate: 1,
summary: `${CeL.wiki.title_link_of(wiki.latest_task_configuration.configuration_page_title,
'Report WPBS syntax error pages')}: ${WPBS_syntax_error_pages.length - 1} page(s)`
'Report WPBS syntax error pages')}: ${WPBS_syntax_error_pages.length} page(s)`
});
}
}
Expand Down Expand Up @@ -3215,6 +3218,12 @@ function maintain_VA_template_each_talk_page(talk_page_data, main_page_title) {
// 避免消除原有內容。
// TODO: https://en.wikipedia.org/w/index.php?title=Talk:Amphetamine&diff=prev&oldid=1192899833
extra_contents = WikiProject_banner_shell_token.parameters[1].toString().trim();
if(/{{\s*WikiProject [.+]+}}/.test(extra_contents)){
// [[w:en:User talk:Kanashimi#Moving 'WikiProject Irish Republicanism' outside of banner shell]]
console.error(`${maintain_VA_template_each_talk_page.name}: WPBS 中包含 {{WikiProject}}!或許是因為執行 categorymembers 時 API 未包含這個 WikiProject?`);
console.trace(extra_contents);
throw new Error('WPBS contains {{WikiProject}}');
}
}
WPBS_template_object[1] = ('\n' + WikiProject_templates_and_allowed_elements
// [[Wikipedia:Bots/Requests for approval/Qwerfjkl (bot) 26]]
Expand Down Expand Up @@ -3404,7 +3413,7 @@ function maintain_VA_template_each_talk_page(talk_page_data, main_page_title) {
}

if (article_info.category_to_clean) {
this.summary += ` (Fix [[${article_info.category_to_clean}]])`;
this.summary += ` (Fix ${CeL.wiki.title_link_of(article_info.category_to_clean)})`;
}

if (!changed) {
Expand Down

0 comments on commit 29d5a92

Please sign in to comment.