Last modified: 2010-10-01 20:13:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27248, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25248 - API: paraminfo errors with certain modules
API: paraminfo errors with certain modules
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.17.x
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php?act...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-22 13:07 UTC by Gurch
Modified: 2010-10-01 20:13 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gurch 2010-09-22 13:07:36 UTC
Using action=paraminfo on the userrights module:

http://en.wikipedia.org/w/api.php?action=paraminfo&modules=userrights

gives the error "The user parameter must be set", as though action=userrights had been called directly. The query works if a 'user' parameter is given -- any user, so long as they exist:

http://en.wikipedia.org/w/api.php?action=paraminfo&modules=userrights&user=User

However, the output of paraminfo is not dependent on this parameter, so it should not be a requirement. No other modules seem to exhibit this behavior; for example

http://en.wikipedia.org/w/api.php?action=paraminfo&modules=edit

works correctly, even though the edit module has required parameters.
Comment 1 Gurch 2010-09-22 16:03:43 UTC
Actually, turns out it's a bit more broken.

In trunk, the equivalent for rollback also gives the error "The title parameter must be set". On WMF sites it works:

http://en.wikipedia.org/w/api.php?action=paraminfo&modules=rollback

This may be related to the recent changes to "required" parameter validation in the API.

Also in trunk, *all* querymodules (e.g. action=paraminfo&querymodules=allpages) cause paraminfo to fail, with an error like this one:

Catchable fatal error: Argument 1 passed to ApiQueryBase::__construct() must be an instance of ApiQuery, instance of ApiParamInfo given, called in ...\includes\api\ApiQueryBase.php on line 467 and defined in ...\includes\api\ApiQueryBase.php on line 43
Comment 2 Gurch 2010-09-23 08:51:24 UTC
Querymodule breakage was caused by r72387.
Comment 3 Sam Reed (reedy) 2010-09-23 09:11:40 UTC
I was thinking for the former it must be more widespread (and presumably it is/should be for all modules that have minimum definitely required parameters)
Comment 4 X! 2010-09-23 10:58:55 UTC
It looks like the paraminfo errors is caused because before PARAM_REQUIRED, required parameter validations were done in the execute() method. Now they're done in the validate parameter methods. When using ApiParaminfo, the execute() method is not called, but the validate parameter methods are. I'm pretty sure this is the problem.
Comment 5 Gurch 2010-09-23 11:11:16 UTC
addressed querymodule breakage in r73596

(In reply to comment #3)
> I was thinking for the former it must be more widespread (and presumably it
> is/should be for all modules that have minimum definitely required parameters)

Only rollback and userrights are affected (haven't tested all extension modules).
Comment 6 Sam Reed (reedy) 2010-09-23 11:20:48 UTC
That's intriguing... In theory, the purge module (among others?), should also be.

Need to get my dev machine back installed (moved it from my parents last night), and have a poke
Comment 7 X! 2010-09-23 12:59:22 UTC
Was going to have a poke at this as well, but realized that when I upgraded to my new OS, I didn't copy the mysql databases. I'll copy them from the backup tonight and have a look.
Comment 8 Sam Reed (reedy) 2010-10-01 19:08:09 UTC
Interesting, on ApiUserrights, disable PARAM_REQUIRED on user, and get

<error code="unknownerror" info="Unknown error: ``&#039;&#039;" xml:space="preserve">
Comment 9 Sam Reed (reedy) 2010-10-01 19:14:54 UTC
And this goes back further, it occurs in 1.16

Userrights didn't exist in 1.15
Comment 10 Sam Reed (reedy) 2010-10-01 20:13:00 UTC
r74098

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links