Last modified: 2013-03-20 17:54:24 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 T46968, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44968 - SpecialItemByTitle must not use Title object to represent remote title.
SpecialItemByTitle must not use Title object to represent remote title.
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
: 44956 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-13 19:41 UTC by Daniel Kinzler
Modified: 2013-03-20 17:54 UTC (History)
5 users (show)

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


Attachments

Description Daniel Kinzler 2013-02-13 19:41:17 UTC
SpecialItemByTitle takes a page title from another wiki as one of its parameters. It then uses a Title object to represent this internally - but that is dangerous and misleading. The rules for titles on the local wiki are not the same as the ones on the target wiki. A title containing a : may be in a well known namespace in one but not the other wiki, changing the canonical name utterly.

Instead, SpecialItemByTitle should use a SiteLink object to represent the title and target wiki internally. Title normalization requires an API call to the target wiki, and should thus be optional (or disabled).
Comment 1 abraham.taherivand 2013-02-14 09:11:27 UTC
*** Bug 44956 has been marked as a duplicate of this bug. ***
Comment 2 jeblad 2013-02-14 11:54:15 UTC
It will not be possible to make this optional if a client wiki uses sitelinks in non-mainspace.
Comment 3 Daniel Kinzler 2013-02-15 09:35:08 UTC
(In reply to comment #2)
> It will not be possible to make this optional if a client wiki uses sitelinks
> in non-mainspace.

Why not? Making it optional just means that no normalization takes place, so the request must then contain the title in already normalized for. Otherwise it will fail. That's inconvenient, but sure possible, no?
Comment 4 jeblad 2013-02-18 15:54:35 UTC
We use normalization to be able to match two links. If those two links are not similar then we will have no match. If we use two different ways to normalize the lookup will fail. Yes we can turn off normalization, no it is not a good idea because the user most often will have no idea why a lookup fails.
Comment 5 jeblad 2013-02-18 15:55:36 UTC
(Bug 44536, Bug 44968) Use SiteLink instead of Title
://gerrit.wikimedia.org/r/#/c/49066/
Comment 6 Daniel Kinzler 2013-02-18 17:06:57 UTC
fixed link to gerrit change: I1176f839
Comment 7 Daniel Kinzler 2013-02-18 17:09:45 UTC
(In reply to comment #4)
> Yes we can turn off normalization, no it is not a good
> idea because the user most often will have no idea why a lookup fails.

Normalizing always is nice, but may be a performance problem. If it is a problem, we can turn it off.

Keep in mind that ItemByTitle really isn't supposed to be used by people directly. We could even mark it as unlisted - maybe we should.

Special:ItemByTitle is merely the backend to our title-based addressing scheme. That scheme says that people should be able to just take a Wikipedia URL, replace "wikipedia" by "wikidata", and the link should work. Since the Title in the URL will be in normalized form, this will work fine without normalization (except for redirects).
Comment 8 abraham.taherivand 2013-03-20 17:54:24 UTC
Verified in Wikidata demo sprint 35-2

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


Navigation
Links