From ec25c7913902d1ec0cab0d17ede98bbda5b3dcf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Fri, 17 Mar 2017 11:36:45 +0000 Subject: [PATCH] Add a tracking category when a template loop is detected Bug: T160743 Change-Id: Ib888634af281fc2347eaa389db4141782a98c15c --- includes/TrackingCategories.php | 1 + includes/parser/Parser.php | 1 + languages/i18n/en.json | 2 ++ languages/i18n/qqq.json | 2 ++ 4 files changed, 6 insertions(+) diff --git a/includes/TrackingCategories.php b/includes/TrackingCategories.php index 825860a5a9..a9ebd762db 100644 --- a/includes/TrackingCategories.php +++ b/includes/TrackingCategories.php @@ -45,6 +45,7 @@ class TrackingCategories { 'expansion-depth-exceeded-category', 'restricted-displaytitle-ignored', 'deprecated-self-close-category', + 'template-loop-category', ]; /** diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 8db1fe3794..47d9a62327 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3257,6 +3257,7 @@ class Parser { $text = '' . wfMessage( 'parser-template-loop-warning', $titleText )->inContentLanguage()->text() . ''; + $this->addTrackingCategory( 'template-loop-category' ); wfDebug( __METHOD__ . ": template loop broken at '$titleText'\n" ); } } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 2ef4f3ae8c..7584a0ac80 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -792,6 +792,8 @@ "post-expand-template-argument-warning": "Warning: This page contains at least one template argument that has a too large expansion size.\nThese arguments have been omitted.", "post-expand-template-argument-category": "Pages containing omitted template arguments", "parser-template-loop-warning": "Template loop detected: [[$1]]", + "template-loop-category": "Pages with template loops", + "template-loop-category-desc": "The page contains a template loop, ie. a template which calls itself recursively.", "parser-template-recursion-depth-warning": "Template recursion depth limit exceeded ($1)", "language-converter-depth-warning": "Language converter depth limit exceeded ($1)", "node-count-exceeded-category": "Pages where node count is exceeded", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index c3a871f881..a67e90f737 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -979,6 +979,8 @@ "post-expand-template-argument-warning": "Used as warning in parser limitation.\n\nSee also:\n* {{msg-mw|Post-expand-template-argument-category}}", "post-expand-template-argument-category": "This message is used as a category name for a [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]] where pages are placed automatically if they contain omitted template arguments.\n\nSee also:\n* {{msg-mw|Post-expand-template-argument-category-desc}}\n* {{msg-mw|Post-expand-template-argument-warning}}", "parser-template-loop-warning": "Parameters:\n* $1 - page title", + "template-loop-category": "This message is used as a category name for a [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]] where pages with template loops will be listed.", + "template-loop-category-desc": "Pages with template loops category description. Shown on [[Special:TrackingCategories]].\n\nSee also:\n* {{msg-mw|Template-loop-category}}", "parser-template-recursion-depth-warning": "Parameters:\n* $1 - limit value of recursion depth", "language-converter-depth-warning": "Error message shown when a page uses too deeply nested language conversion syntax. Parameters:\n* $1 - the value of the depth limit", "node-count-exceeded-category": "This message is used as a category name for a [[mw:Help:Tracking categories|tracking category]] where pages are placed automatically if the node-count of the preprocessor exceeds the limit.\n\nSee also:\n* {{msg-mw|Node-count-exceeded-warning}}", -- 2.20.1