Last modified: 2013-10-31 20:08:43 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 T58216, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56216 - Scribunto: mw.site.namespaces should accept namespace name keys with any capitalisation
Scribunto: mw.site.namespaces should accept namespace name keys with any capi...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-27 14:50 UTC by Mr. Stradivarius
Modified: 2013-10-31 20:08 UTC (History)
4 users (show)

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


Attachments

Description Mr. Stradivarius 2013-10-27 14:50:45 UTC
At the moment mw.site.namespaces accepts namespace names as keys if they are correctly capitalised. The following both work:

mw.site.namespaces['Education Program']
mw.site.namespaces['Education_Program']

However, using keys with different capitalisation doesn't work:

mw.site.namespaces['education program']    --> error
mw.site.namespaces['education_program']    --> error
mw.site.namespaces['Education program']    --> error
mw.site.namespaces['Education_program']    --> error
mw.site.namespaces['EdUcAtiOn pRoGrAm']    --> error
mw.site.namespaces['EdUcAtiOn_pRoGrAm']    --> error

However, all of these work when making wikilinks on normal wiki pages. The following will all get you to the same page:

[[Education Program:Example University/Example Course (2013 Q1)]]
[[education program:Example University/Example Course (2013 Q1)]]
[[Education_program:Example University/Example Course (2013 Q1)]]
[[EdUcAtIoN_pRoGrAm:Example University/Example Course (2013 Q1)]]

It would be useful if all of these variants were accepted as keys to mw.site.namespaces. For example, at [[Module:Namespace detect]] I have discovered a bug in the "education program" parameter. The parameter name ("education program") has to match the lower-case value of title.nsText ("education_program"), but they don't match because of the underscore. Allowing both of these as keys would be a neat way to work around the problem.
Comment 1 Mr. Stradivarius 2013-10-27 15:15:25 UTC
I've posted a related issue at Bug 56217.
Comment 2 Mr. Stradivarius 2013-10-27 15:48:25 UTC
I've just realised that surrounding whitespace and underscores can work as wikilinks too:

[[_ EdUcAtIon PrOgRaM _:Example University/Example Course (2013 Q1)]]

I think cases like this should also be valid keys.
Comment 3 Gerrit Notification Bot 2013-10-31 15:55:12 UTC
Change 92886 had a related patch set uploaded by Anomie:
Properly handle spaces/underscores in mw.site.namespaces

https://gerrit.wikimedia.org/r/92886
Comment 4 Gerrit Notification Bot 2013-10-31 19:36:05 UTC
Change 92886 merged by jenkins-bot:
Properly handle spaces/underscores in mw.site.namespaces

https://gerrit.wikimedia.org/r/92886
Comment 5 Brad Jorsch 2013-10-31 20:08:43 UTC
Fix is merged. It should be deployed to WMF wikis with 1.23wmf3, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.

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


Navigation
Links