Page MenuHomePhabricator

API: action=parse should default to wikitext contentmodel if no title given
Closed, ResolvedPublic

Description

http://www.wikidata.org/w/api.php?action=parse&format=json&text=%5B%5BSpecial%3AUserLogin%7CLog+in%5D%5D+to+select+a+different+language+for+menus%2E

returns:
{"servedby":"mw1193","error":{"code":"parseerror","info":"failed to deserialize"}}

This affects among other things the Universal Language Selector and the Translate extensions which rely on it to produce part of the interface.


Version: 1.21.x
Severity: major

Details

Reference
bz48201

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:17 AM
bzimport set Reference to bz48201.
bzimport added a subscriber: Unknown Object (MLST).

You can append "&contentmodel=wikitext" and then it works.

Since Wikidata has items in the main namespace, then it appears to assume json content model and can't parse the text.

I would consider this high priority.

(In reply to comment #2)

I would consider this high priority.

Well, there is a simple workaround in comment 1.

(In reply to comment #3)

(In reply to comment #2)

I would consider this high priority.

Well, there is a simple workaround in comment 1.

The workaround can't be used by users to make ULS and Translate work again, so it's useless. :)
I think this bug is about restoring expected behaviour and avoid this breaking change in the API?

It doesn't seem unreasonable for action=parse to assume a wikitext content model in the case its asked to parse content and is not given a context title, and the page "Api" would be in a different content model then wikitext.

Thanks for comments/explanations (very appreciated).
So I'll set it to high prio now, to be on the safe side.

Related URL: https://gerrit.wikimedia.org/r/69470 (Gerrit Change Ie4f7324c2a10700e52dadc4facd6b4fe6c76cf48)

Related URL: https://gerrit.wikimedia.org/r/69472 (Gerrit Change I51143873e3782df4df500194a7ac71c4b446746b)

Gerrit change 69470 (and the followup Gerrit change 69494) were merged on the 19th.