Merge "Show ParserOutput warning instead of on the actual page output for ignored...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 2 Jun 2016 21:23:04 +0000 (21:23 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 2 Jun 2016 21:23:04 +0000 (21:23 +0000)
includes/parser/CoreParserFunctions.php
tests/parser/parserTests.txt

index 6b847e5..01cce02 100644 (file)
@@ -460,14 +460,14 @@ class CoreParserFunctions {
                                return '';
                        }
                } else {
-                       $parser->addTrackingCategory( 'restricted-displaytitle-ignored' );
                        $converter = $parser->getConverterLanguage()->getConverter();
-                       return '<span class="error">' .
+                       $parser->getOutput()->addWarning(
                                wfMessage( 'restricted-displaytitle',
                                        // Message should be parsed, but this param should only be escaped.
                                        $converter->markNoConversion( wfEscapeWikiText( $text ) )
-                               )->inContentLanguage()->text() .
-                               '</span>';
+                               )->text()
+                       );
+                       $parser->addTrackingCategory( 'restricted-displaytitle-ignored' );
                }
        }
 
index 2f5450c..6c3841d 100644 (file)
@@ -20666,7 +20666,6 @@ this is not the the title
 !! html/php
 Screen
 <p>this is not the the title
-<span class="error"><strong>Warning:</strong> Display title "whatever" was ignored since it is not equivalent to the page's actual title.</span>
 </p>
 !! end