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

--- Comment #14 from MWJames <[email protected]> ---
> just because you can write a unit test showing that the bug was fixed in 1.23 
> doesn't mean we should unfix the bug.

Let me explain what the test does before you claim that the test is wrong.

When I have a page with '[[Lorem ipsum]] dolor sit amet ...' text and try to
generate a ParserOutput object using either $this->parser->parse( ... ) or
$content->getParserOutput( ... ) at some point the InternalParseBeforeLinks
will be called and the hook interface ( &$parser, &$text ) where $text will
contain '[[Lorem ipsum]] dolor sit amet ...' (for both cases ).

Now, when I have a page with '#REDIRECT [[...]]' text and try to generate a
ParserOutput object using $this->parser->parse( ... ) where at some point the
InternalParseBeforeLinks will be called, the hook interface (&$parser, &$text)
with $text will contain '#REDIRECT [[...]]' but when $content->getParserOutput(
... ) is used the $text is empty (which should contain '#REDIRECT [[...]]').

The in behaviour is tested for a standard text and a text containing '#REDIRECT
...'.

Of course, if you are telling me that this is the expected behaviour then
naturally you can argue that MW 1.21/MW 1.22 were wrong in the first place and
that MW 1.23 has been fixed.

> If you continue to just blindly insist that you're right and everyone else is 
> wrong

Interesting, I'm not insisting on anything the only thing I'm asserting
(actually the test is asserting) is a difference in behaviour for
InternalParseBeforeLinks hook on the usage of $this->parser->parse(...) to
$content->getParserOutput( ... ) for when #REDIRECT is involved nothing more
and nothing less.

> we may as well close this bug as WONTFIX (or reassign it to MediaWiki core 
> and mark it INVALID again).

If this is the WMF approach nothing left for me to do.

> by you telling us what exactly SMW is doing by looking for the #REDIRECT in 
> the wikitext passed to the parser and why it can't look in the redirect table 
> or Content::getRedirectTarget()

As for SMW, InternalParseBeforeLinks is used to create annotations.

If the text component delivered by the InternalParseBeforeLinks hook carries a
"#REDIRECT target" (which works of course if we use  $this->parser->parse(...)
and worked for $content->getParserOutput( .. ) on MW 1.21/MW 1.22 ) then
something like 
ContentHandler::makeContent( $text, null, CONTENT_MODEL_WIKITEXT
)->getRedirectTarget() or Title::newFromRedirect( $text ) will work as
expected.

The problem is that text component retrieved through the
InternalParseBeforeLinks hook no longer carries the "#REDIRECT  ...".

-- 
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
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to