Add "displaytitle" to query/info API
Closed, ResolvedPublic

Description

Author: pol

Description:
Some pages have a display title different from the title for instance the page "IPad" has a display title of "iPad".

The "parse" API correctly returns the display title:
http://en.wikipedia.org/w/api.php?action=parse&page=IPad
<?xml version="1.0"?>
<api>

<parse displaytitle="iPad" revid="367656791">
...

But the "query" / "info" API does not:
http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=IPad
<?xml version="1.0"?>
<api>

<query>
  <pages>
    <page pageid="25970423" ns="0" title="IPad" touched="2010-06-12T20:42:33Z" lastrevid="367656791" counter="0" length="62248" />
  </pages>
</query>

</api>

Please add a "displaytitle" attribute to the "query" / "info" API.


Version: 1.17.x
Severity: enhancement

bzimport added a project: MediaWiki-API.Via ConduitNov 21 2014, 11:03 PM
bzimport set Reference to bz23936.
bzimport created this task.Via LegacyJun 13 2010, 12:42 AM
Reedy added a comment.Via ConduitJun 13 2010, 1:26 AM

Trivial, changing to enhancement (as that's what it is)

Just, unless i'm missing something, we're gonna have to pull the page text, and shove it through the parser to get it to deal with the title...

Catrope added a comment.Via ConduitJun 13 2010, 11:28 AM

(In reply to comment #1)

Trivial, changing to enhancement (as that's what it is)

Just, unless i'm missing something, we're gonna have to pull the page text, and
shove it through the parser to get it to deal with the title...

That would be kinda ridiculous. It would be better to store the displaytitle in the page_props table, if it isn't already. The ParserOutput class has a nice interface for this (ParserOutput::setProperty()).

Reedy added a comment.Via ConduitJun 13 2010, 1:07 PM

I didn't say it was sane :P (hence the ellipse)

Catrope added a comment.Via ConduitJul 21 2010, 12:51 PM

(In reply to comment #2)

That would be kinda ridiculous. It would be better to store the displaytitle in
the page_props table, if it isn't already. The ParserOutput class has a nice
interface for this (ParserOutput::setProperty()).

This was done in r69235, which should make this bug rather trivial.

bzimport added a comment.Via ConduitJul 21 2010, 12:53 PM

Bryan.TongMinh wrote:

Note that wikis should run refreshLinks.php I think for this to work completely.

Catrope added a comment.Via ConduitJul 21 2010, 12:54 PM

(In reply to comment #5)

Note that wikis should run refreshLinks.php I think for this to work
completely.

Yes, it won't be populated instantly, but the fact that it populates on edit or purge should be good enough.

Reedy added a comment.Via ConduitJul 21 2010, 6:57 PM

I'm presuming, if the user requests DisplayTitle, and the pageprops has nothing for the page for it's display title, just give the actual title?

Catrope added a comment.Via ConduitJul 21 2010, 11:11 PM

(In reply to comment #7)

I'm presuming, if the user requests DisplayTitle, and the pageprops has nothing
for the page for it's display title, just give the actual title?

Yes. In the ideal world where the table is fully populated, that really does mean it'll be displayed that way. In the real world, it might be off because that page may not have its displaytitle written to the table yet, but I think that's acceptable.

Reedy added a comment.Via ConduitJul 22 2010, 8:49 AM

r67919

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.