(bug 22887) Add warning and tracking category for preprocessor errors
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 21 Apr 2012 11:09:03 +0000 (13:09 +0200)
committerReedy <reedy@wikimedia.org>
Fri, 27 Apr 2012 15:16:35 +0000 (16:16 +0100)
I have only add things and not change the current error strings to
messages, because bug 21521 is WONTFIX

Change of Preprocessor_HipHop.php is not tested

Change-Id: I7a7243b8ba010dbb395bdbbb3e00e3217088038e

RELEASE-NOTES-1.20
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/parser/Preprocessor_HipHop.hphp
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 318768c..a9e9a32 100644 (file)
@@ -45,6 +45,7 @@ production.
 * (bug 35685) api.php URL and other entry point URLs are now listed on
   Special:Version
 * Edit notices can now be translated.
+* (bug 22887) Add warning and tracking category for preprocessor errors
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
index f129f73..18bd01c 100644 (file)
@@ -958,10 +958,18 @@ class PPFrame_DOM implements PPFrame {
                }
 
                if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() ) {
+                       $this->parser->limitationWarn( 'node-count-exceeded',
+                               $this->parser->mPPNodeCount,
+                               $this->parser->mOptions->getMaxPPNodeCount()
+                       );
                        return '<span class="error">Node-count limit exceeded</span>';
                }
 
                if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) {
+                       $this->parser->limitationWarn( 'expansion-depth-exceeded',
+                               $expansionDepth,
+                               $this->parser->mOptions->getMaxPPExpandDepth()
+                       );
                        return '<span class="error">Expansion depth limit exceeded</span>';
                }
                wfProfileIn( __METHOD__ );
index 28283c7..4acb124 100644 (file)
@@ -915,9 +915,17 @@ class PPFrame_Hash implements PPFrame {
                }
 
                if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() ) {
+                       $this->parser->limitationWarn( 'node-count-exceeded',
+                                       $this->parser->mPPNodeCount,
+                                       $this->parser->mOptions->getMaxPPNodeCount()
+                       );
                        return '<span class="error">Node-count limit exceeded</span>';
                }
                if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) {
+                       $this->parser->limitationWarn( 'expansion-depth-exceeded',
+                                       $expansionDepth,
+                                       $this->parser->mOptions->getMaxPPExpandDepth()
+                       );
                        return '<span class="error">Expansion depth limit exceeded</span>';
                }
                ++$expansionDepth;
index aedcac2..a23168a 100644 (file)
@@ -1073,9 +1073,17 @@ class PPFrame_HipHop implements PPFrame {
                }
 
                if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() ) {
+                       $this->parser->limitationWarn( 'node-count-exceeded',
+                                       $this->parser->mPPNodeCount,
+                                       $this->parser->mOptions->getMaxPPNodeCount()
+                       );
                        return '<span class="error">Node-count limit exceeded</span>';
                }
                if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) {
+                       $this->parser->limitationWarn( 'expansion-depth-exceeded',
+                                       $expansionDepth,
+                                       $this->parser->mOptions->getMaxPPExpandDepth()
+                       );
                        return '<span class="error">Expansion depth limit exceeded</span>';
                }
                ++$expansionDepth;
index 2fa9002..bb08078 100644 (file)
@@ -1478,6 +1478,10 @@ These arguments have been omitted.",
 'parser-template-loop-warning'            => 'Template loop detected: [[$1]]',
 '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',
+'node-count-exceeded-warning'             => 'Page exceeded the node-count',
+'expansion-depth-exceeded-category'       => 'Pages where expansion depth is exceeded',
+'expansion-depth-exceeded-warning'        => 'Page exceeded the expansion depth',
 
 # "Undo" feature
 'undo-success' => 'The edit can be undone.
index bd7733e..a9c77ee 100644 (file)
@@ -1020,6 +1020,16 @@ When templates are expanded, there is a size limit for the number of bytes yield
 'language-converter-depth-warning' => 'Error message shown when a page uses too deeply nested language conversion syntax
 
 * <tt>$1</tt> is 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.',
+'node-count-exceeded-warning'             => 'Error message shown when a page exceeded the node-count limit of the preprocessor
+
+* <tt>$1</tt> is the value of the node-count limit
+* <tt>$2</tt> is the value of the max node-count limit',
+'expansion-depth-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 expansion depth of the preprocessor exceeds the limit.',
+'expansion-depth-exceeded-warning'        => 'Error message shown when a page exceeded the expansion depth limit of the preprocessor
+
+* <tt>$1</tt> is the value of the depth limit
+* <tt>$2</tt> is the value of the max depth limit',
 
 # "Undo" feature
 'undo-success' => 'Text on special page to confirm edit revert. You arrive on this page by clicking on the "undo" link on a revision history special page.
index b656000..d22449b 100644 (file)
@@ -688,6 +688,10 @@ $wgMessageStructure = array(
                'parser-template-loop-warning',
                'parser-template-recursion-depth-warning',
                'language-converter-depth-warning',
+               'node-count-exceeded-category',
+               'node-count-exceeded-warning',
+               'expansion-depth-exceeded-category',
+               'expansion-depth-exceeded-warning',
        ),
        'undo' => array(
                'undo-success',