Page MenuHomePhabricator

redirecttitle in API:Search returns title object instead of text
Closed, ResolvedPublic

Description

Instead of returning just the redirect page name, like the "title" value does, "redirecttitle" returns the entire Title object. This appears to be the fault of ApiQuerySearch.php rather than any specific search engine.

Example: https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Heteroscedasticity&srprop=redirecttitle

Event Timeline

RobinHood70 raised the priority of this task from to Needs Triage.
RobinHood70 updated the task description. (Show Details)
RobinHood70 added a project: MediaWiki-API.
RobinHood70 added a subscriber: RobinHood70.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 3 2015, 4:54 AM
RobinHood70 updated the task description. (Show Details)Feb 3 2015, 4:56 AM
RobinHood70 set Security to None.
RobinHood70 updated the task description. (Show Details)Feb 3 2015, 5:13 AM
RobinHood70 updated the task description. (Show Details)Feb 3 2015, 5:18 AM
Aklapper triaged this task as Low priority.Feb 3 2015, 9:15 AM
gerritbot added a subscriber: gerritbot.

Change 188372 had a related patch set uploaded (by Anomie):
API: Don't dump Title object into API result

https://gerrit.wikimedia.org/r/188372

Patch-For-Review

Anomie claimed this task.Feb 3 2015, 3:03 PM
Anomie added a project: MediaWiki-Core-Team.
Anomie moved this task from Backlog to Needs Review/Feedback on the MediaWiki-Core-Team board.
Fomafix added a subscriber: Fomafix.Feb 3 2015, 3:24 PM

The code was added in ce9bd769 in Nov 1 2010. Certainly it was intended to return only the title instead of the entire object. But for the last 4 years the API delivers the object. Are there any clients that expect the current structure?

FYI: This not effect format=xml because it calls toString for objects (internal reasons).

Change 188372 merged by jenkins-bot:
API: Don't dump Title object into API result

https://gerrit.wikimedia.org/r/188372

Legoktm closed this task as Resolved.Feb 3 2015, 5:28 PM
Legoktm added a subscriber: Legoktm.
Krenair added a subscriber: Krenair.Feb 3 2015, 5:43 PM

Sounds like a similar thing to T45518 - but with a Title object rather than another User.

Anomie added a comment.Feb 3 2015, 5:54 PM

Fortunately the Title object output doesn't contain sensitive data.

bd808 moved this task from Done to Archive on the MediaWiki-Core-Team board.Feb 5 2015, 1:58 AM