Last modified: 2011-07-17 14:56:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31931, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29931 - Queries restricting results to namespace fail when namespaces contain spaces
Queries restricting results to namespace fail when namespaces contain spaces
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized minor (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-17 07:00 UTC by Nathan Douglas
Modified: 2011-07-17 14:56 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nathan Douglas 2011-07-17 07:00:36 UTC
MW: 1.17.0
SMW: 1.5.6
Example: http://sandbox.semantic-mediawiki.org/wiki/Namespace_Error

If you perform a query of the type {{#ask:[[Namespace:+]]|...}}, the query will fail if the namespace name contains spaces.  If the name is provided explicitly, the query will simply fail nastily.  If the name is provided by some other means (for instance, the Variable Extension), it will cause a fatal error.

SMW_QueryParser.php (on line 434, as of 1.5.6) contains the following code:

$idx = $wgContLang->getNsIndex($list[0]);

It should be something more like:

$idx = $wgContLang->getNsIndex(str_replace(" ","_",$list[0]));

Thanks!
Comment 1 Jeroen De Dauw 2011-07-17 14:56:13 UTC
Thanks for the patch! I just comitted it in r92394 :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links