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

--- Comment #10 from Dan Nessett <[email protected]> 2012-01-13 20:17:34 UTC 
---
I found the problem causing ApiQueryTest::testTitlesGetNormalized to fail, but
I don't know exactly how to fix it.

ApiQuery:execute() calls:
$this->mPageSet->execute() (line 254) calls:
$this->initFromTitles( $params['titles'] ) (line 303) calls:
$linkBatch = $this->processTitlesArray( $titles ) (line 414) calls:
$unconvertedTitle = $titleObj->getPrefixedText() (line 678) calls:
str_replace( '_', ' ', $s ) (line 1127)

In the test case, $wgMetaNamespace is left at its default set in
DefaultSettings.php (false) and so is set to the value of $wgSitename, which in
the test case is "MW_latest". The underscore is being replaced by a blank
character, so the test fails when comparing the 'to' array entry expected and
that returned.

One way to fix this is to change the test by replacing all spaces in the
returned 'to' entry namespace prefix  with underscores, but I suspect this just
covers over a bug. So, somewhere in the code, there is an assumption made that
$wgMetaNamespace is a string without spaces/underscores. This assumption should
be removed.

Just for the record, I checked and underscores are legal in namespace prefixes
(http://www.mediawiki.org/wiki/Manual:Title.php).

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
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