Last modified: 2007-07-03 15:34:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8959 - Provide consistent normalised title information in PHP output for "backlinks" and "imageinfo" operations
Provide consistent normalised title information in PHP output for "backlinks"...
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
BotQuery (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
http://de.wikipedia.org/w/query.php?w...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-12 19:59 UTC by Marco
Modified: 2007-07-03 15:34 UTC (History)
1 user (show)

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


Attachments

Description Marco 2007-02-12 19:59:15 UTC
When using the link as shown above (with localized name spaces!!!), there is no
information about the page ID delivered in the serialized PHP output, only a
index key in the array which sizeof() can't detect. This renders the backlink
function pretty unusable as I can't access the page's backlinks.

Strange is, if you use English namespace names like in
http://de.wikipedia.org/w/query.php?what=backlinks&titles=User:HardDisk&bllimit=11&format=php
the page ID is delivered at $array["pages"][-1]["refid"].
Comment 1 Marco 2007-02-12 20:30:59 UTC
The array key missing is at http://mediawiki.pastey.net/6501?hi=250 (line 250)
Comment 2 Rob Church 2007-02-12 20:34:15 UTC
Referring to http://mediawiki.pastey.net/6500, which is the result of print_r(
unserialize( <contents of URL in URL field> ) ), it's quite obvious that there
is an easily accessible page identifier, and this is duplicated, in fact, so
it's quite possible to access the information required.

I'm guessing that the information Marco's talking about is injected to indicate
any applicable namespace translations between languages and so forth, and so
won't be present when viewing the thing in German. We should *probably* be
consistent about providing this.
Comment 3 Marco 2007-02-12 20:36:47 UTC
Well, you cannot access the  page ID that easily. It is hidden in itself (lines
160/164 at http://mediawiki.pastey.net/6501), so you cannot access them without
a really huge mess with foreach.
Comment 4 Marco 2007-02-13 18:03:13 UTC
Same thing is going on with imageinfo. Again, here the image ID is hidden in
itself when the name supplied is English namespace.
Comment 5 Marco 2007-02-13 18:03:42 UTC
Same thing is going on with imageinfo. Again, here the image ID is hidden in
itself when the name supplied is English namespace.
Comment 6 Roan Kattouw 2007-06-25 13:26:08 UTC
So if I understand you well, you are complaining about the fact that

Array (
    [12345] => Array(
        [pageid] => 12345
        etc.
    )
)
(rough sketch)

hides the pageid inside the pageid. This is true. But you may be forgetting that backlinks can take multiple page titles:

http://de.wikipedia.org/w/query.php?what=backlinks&titles=User:HardDisk|User%20talk:HardDisk&bllimit=11

in which case the result looks like:

Array (
    [12345] => Array(
        [pageid] => 12345
        [title] => User:HardDisk
        more info
    )
    [130569] => Array(
        [pageid] => 130569
        [title] => User talk:HardDisk
    )
)

So you will *have* to foreach() the pages array, which contains only one element if you specified one title (or two if the title had to be localized). Foreach()ing on a one-element array doesn't sound that horrible to me, especially considering what=backlinks is designed to be usable for multiple targets in one request.
Comment 7 Roan Kattouw 2007-07-03 15:34:47 UTC
Closing as INVALID. If you still have complaints, please reopen this bug.

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


Navigation
Links