Page MenuHomePhabricator

API - "The page parameter cannot be used together with the text and title parameters" error
Closed, InvalidPublic

Description

Using the API to parse a page is not working properly. My query string looks like this:
/api.php?action=parse&page=Houdini

It returns this response:
<?xml version="1.0"?>
<api>

<error code="params" info="The page parameter cannot be used together with the text and title parameters" xml:space="preserve">

I am using mw 1.15.1 i get nothing of value from the mw debug log and i have verified that my rewrite rules are not adding the title parameter. If i change my query string to this:

/api.php?action=parse&text={{Houdini}}

I get the expected result.

(see http://www.mediawiki.org/w/index.php?title=Talk:API:Parsing_wikitext&diff=prev&oldid=297592 for more info)


Version: 1.15.x
Severity: normal

Details

Reference
bz22684

Event Timeline

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

Bryan.TongMinh wrote:

WORKSFORME on REL1_15 as well.

en.wikipedia.org is running version "1.16alpha-wmf".

Here's an example of how it doesn't work on my site (which runs 1.15.1):
http://tmbw.net/wiki/api.php?action=parse&page=Sandbox

Can you give me more information about what you mean "re-writes"? Are you talking about rewrites in .htaccess? Can you explain how those would potentially affect this?

Thanks

(In reply to comment #3)

en.wikipedia.org is running version "1.16alpha-wmf".

Yes, it's possible the bug was fixed between 1.15 and the 1.16alpha version Wikipedia runs. If that's the case we're still gonna do nothing: 1.16 will be released soonish anyway.

Here's an example of how it doesn't work on my site (which runs 1.15.1):
http://tmbw.net/wiki/api.php?action=parse&page=Sandbox

Can you give me more information about what you mean "re-writes"? Are you
talking about rewrites in .htaccess?

Yes.

Can you explain how those would
potentially affect this?

They could (wrongly) add a &title= parameter to the rewritten URL. Some quick research seems to confirm this: POSTing to http://twbw.net/wiki/api.php?action=rollback throws an error about the user param not being set, while the code checks for the title parameter first.

Re-closing as INVALID, the above is fairly strong evidence that this is not a MediaWiki bug, but a problem with your rewrite rules.