https://bugzilla.wikimedia.org/show_bug.cgi?id=62856

            Bug ID: 62856
           Summary: ContentHandler / #REDIRECT missing when using
                    $content->getParserOutput( ...)
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: ContentHandler
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: jamesin.hongkon...@gmail.com
                CC: daniel.kinz...@wikimedia.de
       Web browser: ---
   Mobile Platform: ---

During our SMW\Test\SimplePageRedirectRegressionTest::testDataImport MW
1.23alpha (5b8215c) failed due to #REDIRECT being missing from the
$parserOutput->
getText() when using $content->getParserOutput( ... ).

The test passes on MW versions that don't use the ContentHandler and instead
use $this->parser->parse( ... ).

Code used in MW 1.23

$revision = Revision::newFromTitle( $this->getTitle(), false,
Revision::READ_NORMAL );

$content = $revision->getContent( Revision::RAW );

$this->parserOutput = $content->getParserOutput(
    $this->getTitle(),
    $revision->getId(),
    null,
    true
);

### Test output using var_dump for $content->getParserOutput( ...)
3) SMW\Test\SimplePageRedirectRegressionTest::testDataImport
This test printed output: string(18) "[[Has type::Page]]"
string(18) "[[Has type::Page]]"
string(33) "[[Category:Simple redirect test]]"
string(33) "[[Category:Simple redirect test]]"
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(33) "[[Category:Simple redirect test]]"
string(40) "Content of NewPageRedirectRegressionTest"
string(40) "Content of NewPageRedirectRegressionTest"
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "

Code used prior the ContentHandler

$revision = Revision::newFromTitle( $this->getTitle() );

$this->parserOutput = $this->parser->parse(
    $revision->getText(),
    $this->getTitle(),
    $this->makeParserOptions(),
    true,
    true,
    $revision->getID()
);

### Test output using var_dump using $this->parser->parse( ... )
3) SMW\Test\SimplePageRedirectRegressionTest::testDataImport
This test printed output: string(18) "[[Has type::Page]]"
string(18) "[[Has type::Page]]"
string(33) "[[Category:Simple redirect test]]"
string(33) "[[Category:Simple redirect test]]"
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(80) "#REDIRECT [[SimplePageRedirectRegressionTest]] [[Category:Simple
redirect test]]"
string(40) "Content of NewPageRedirectRegressionTest"
string(40) "Content of NewPageRedirectRegressionTest"
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "
string(141) "This is part of the [[PageRedirectRegressionTest]]
[[Category:Regression test]] [[Category:Redirect test]] [[Category:Simple
redirect test]] "

"#REDIRECT [[SimplePageRedirectRegressionTest]] is missing from the
ContentHandler generated ParserOuptut text object.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to