Page MenuHomePhabricator

web API of 'action=parse' get a error of ParserOptions
Closed, ResolvedPublic

Description

I used the api to get sections information to build my custom toc.
Like

/w/api.php?action=parse&format=json&oldid=<the oldid>&prop=sections&disablelimitreport=1

But a few days age, I found it didn't work and I checked that it gets a error.
It says:

[WT81eApAAE4AAAUL8GwAAABB] Exception caught: The supplied ParserOptions are not safe to cache. Fix the options or set $forceParse = true.

It seems like it's a error of mw parser's ParserOptions which it can't be configured by the interface of the web API. Maybe it need to be fixed.

Event Timeline

Cwek created this task.Jun 13 2017, 12:54 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 13 2017, 12:54 AM
Cwek added a comment.Jun 13 2017, 1:17 AM

I check it again in APIsandbox, and I find that it will work again if I remove the option 'disablelimitreport'.

Anomie claimed this task.Jun 13 2017, 1:35 PM
Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.
Anomie added a project: Patch-For-Review.
Anomie closed this task as Resolved.Jun 13 2017, 2:28 PM

This should be deployed to WMF wikis with 1.30.0-wmf.5, see https://www.mediawiki.org/wiki/MediaWiki_1.30/Roadmap for the schedule. In the mean time, you might test it on https://en.wikipedia.beta.wmflabs.org.