Add a tracking category when a template loop is detected
authorMatěj Suchánek <matejsuchanek97@gmail.com>
Fri, 17 Mar 2017 11:36:45 +0000 (11:36 +0000)
committerMatěj Suchánek <matejsuchanek97@gmail.com>
Fri, 17 Mar 2017 11:52:38 +0000 (11:52 +0000)
Bug: T160743
Change-Id: Ib888634af281fc2347eaa389db4141782a98c15c

includes/TrackingCategories.php
includes/parser/Parser.php
languages/i18n/en.json
languages/i18n/qqq.json

index 825860a..a9ebd76 100644 (file)
@@ -45,6 +45,7 @@ class TrackingCategories {
                'expansion-depth-exceeded-category',
                'restricted-displaytitle-ignored',
                'deprecated-self-close-category',
+               'template-loop-category',
        ];
 
        /**
index 8db1fe3..47d9a62 100644 (file)
@@ -3257,6 +3257,7 @@ class Parser {
                                $text = '<span class="error">'
                                        . wfMessage( 'parser-template-loop-warning', $titleText )->inContentLanguage()->text()
                                        . '</span>';
+                               $this->addTrackingCategory( 'template-loop-category' );
                                wfDebug( __METHOD__ . ": template loop broken at '$titleText'\n" );
                        }
                }
index 2ef4f3a..7584a0a 100644 (file)
        "post-expand-template-argument-warning": "<strong>Warning:</strong> 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",
index c3a871f..a67e90f 100644 (file)
        "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}}",