Page MenuHomePhabricator

Errors when a module is used for both generator and prop and limit=max is used for both
Closed, ResolvedPublic

Description

When a module is used both as the generator for a query and in the normal "prop", and both limits are set to 'max', the API gives an error because it tries to add the value to the "limits" node in the result twice.

For example, in the URL above I am trying to find all the Wikipedia-namespace pages transcluded onto [[en:WP:BRFA]], along with the revision ID and the templates each one transcludes.


Version: 1.16.x
Severity: normal
URL: http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&generator=templates&titles=Wikipedia:Bots/Requests%20for%20approval&gtlnamespace=4&gtllimit=max&prop=revisions|templates&rvprop=ids&tllimit=max

Details

Reference
bz21310

Event Timeline

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

Bryan.TongMinh wrote:

What should be the correct behaviour? Ignore the second assignment I presume, but is it possible to have different limits in the generator and normal mode?

(In reply to comment #1)

What should be the correct behaviour? Ignore the second assignment I presume,
but is it possible to have different limits in the generator and normal mode?

Yes, this is possible, but only by using backlinks twice (once with and once without blredirect).

Ignoring the second assignment in the general case would fail per the above, and would remove a valuable telltale sign of bugs. I was thinking we could prefix generators with a 'g' in the <limits> tag, although that would be a breaking change.

(In reply to comment #2)

I was thinking we could
prefix generators with a 'g' in the <limits> tag, although that would be a
breaking change.

You could output both the 'g' and non-'g' versions for the (common) cases where this error does not occur, if you really want to avoid the breaking change. OTOH, I wonder how many people actually use <limits> instead of just continuing to specify "max".

As written, this bug is fixed as of r70078. If anyone cares enough to ask for Roan's suggestion from comment #2, I'd think that should be filed as a new feature request bug.