Page MenuHomePhabricator

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

Details

Reference
bz23936

Related Objects

StatusSubtypeAssignedTask
ResolvedCatrope
OpenFeatureNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:03 PM
bzimport set Reference to bz23936.

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...

(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()).

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

(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.

Bryan.TongMinh wrote:

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

(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.

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?

(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.