Expose Title::isKnown() status via the API
Closed, ResolvedPublic

Description

To support VisualEditor, we need to somehow expose Title::isKnown() status for pages via the API. Ideally this would be a prop= query module so it can be combined with other queries...

Legoktm created this task.Aug 3 2016, 7:08 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 3 2016, 7:08 AM

It's probably not feasible to implement this in PrefixEngine (since scanning is a superset of existence checks).

But if feasible, then that would solve this and related problems. For example, when typing User:Krinkle in the search box on a wiki, I'd expect to find the global user page just the same as it would a local user page. Similarly, File: would autocomplete file foreign file repositories as well.

It seems in production, the latter (foreign file completion) actually works by default because the multimedia index is included in all Wikimedia wikis somehow. (It doesn't work when you do it on Vagrant, for example).

But for now, being able to color manually crafted links would be a good start. As additional property in addition to the default negated (bool)missing property there could be a (bool)known property. Either by default, or as new queryprop module.

mw.widget.TitleWidget already does a query for this with several prop modules specified. We could easily add another one.

Though for end-users, as difficult as it might sound; without prefixindex it's really just a small fix for edge cases were you manually entered or copied some text - You wouldn't have confidence that the link exists until the last character is typed.

Anomie added a subscriber: Anomie.Aug 4 2016, 12:32 PM

Ideally this would be a prop= query module so it can be combined with other queries...

Just add it to ApiQueryInfo? That seems like the best place for it.

Whether it needs an inprop or not depends on whether it's expensive enough that we would only want to do it when needed instead of on every prop=info request.

Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Aug 4 2016, 12:32 PM

Change 304874 had a related patch set uploaded (by Anomie):
API: Add a 'known' property when missing-but-known titles are output

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

Anomie moved this task from Needs Code to Needs Review on the MediaWiki-API board.Aug 15 2016, 6:41 PM

Change 304874 merged by jenkins-bot:
API: Add a 'known' property when missing-but-known titles are output

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

Anomie closed this task as "Resolved".Oct 11 2016, 5:45 PM
Anomie claimed this task.