Last modified: 2013-04-22 16:14: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 T47774, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45774 - mw.title.exists does not properly handle the Media: idiom used by #ifexist
mw.title.exists does not properly handle the Media: idiom used by #ifexist
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-06 12:57 UTC by Alexander Jones
Modified: 2013-04-22 16:14 UTC (History)
4 users (show)

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


Attachments

Description Alexander Jones 2013-03-06 12:57:52 UTC
The current version of the mw.title library as used on test2 does not properly handle the existence of non-local (Commons) files. Instead of a title object for "Media:<filename>" having a true "exists" value, as #ifexist does if a file by that name has been uploaded to the Commons, said "exists" value is false. Based on my quick inspection of the code, it appears that the library does not give special treatment to the Media: namespace, unlike the original parser function.

Example:

exampleFile = mw.title.new("Media:I-10.svg")
print(exampleFile.exists)

Expected result:
true

Actual result:
false
Comment 1 Brad Jorsch 2013-03-07 21:58:24 UTC
Gerrit change #52697
Comment 2 Alex Monk 2013-03-10 13:21:00 UTC
Merged by Aaron Schulz on the 8th. Is this bug fixed now?
Comment 3 Alexander Jones 2013-03-10 13:28:25 UTC
I won't know until the test wiki is updated. Should I install a local copy to test it out?
Comment 4 Brad Jorsch 2013-03-11 15:01:34 UTC
Should be fixed now; if not, the bug can always be reopened.

@Alexander Jones: You certainly could install a local copy to test it out, such a local copy is *very* useful for MediaWiki development and testing. But you should also be able to test this in Beta Labs, which among other things has http://en.wikipedia.beta.wmflabs.org/ set up with a configuration equivalent to enwiki but running the latest git master.
Comment 5 Alexander Jones 2013-03-11 18:32:30 UTC
@Brad Jorsch: Said wiki doesn't have access to Commons, so that's a no-go. I'll work on installing Scribunto on my local wiki (which does have access to Commons) tomorrow.
Comment 6 Brad Jorsch 2013-03-11 19:15:16 UTC
(In reply to comment #5)
> Said wiki doesn't have access to Commons, so that's a no-go. I'll
> work on installing Scribunto on my local wiki (which does have access to
> Commons) tomorrow.

It does have access to the Beta version of Commons, http://commons.wikimedia.beta.wmflabs.org/.

If you use an image there, e.g. http://commons.wikimedia.beta.wmflabs.org/wiki/File:500px-IP.svg.png, it appears to work correctly in a quick test.
Comment 7 Alexander Jones 2013-03-11 20:46:00 UTC
Checks out for me too. Thanks!

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


Navigation
Links