Page MenuHomePhabricator

API: redirects generator ignores grdnamespace
Closed, ResolvedPublicBUG REPORT

Description

Queries with action=query&titles=Foo&generator=redirects&grdnamespace=5
like here do not filter results according to namespace.

In contrast, when not called as a generator, but simply with action=query&titles=Foo&prop=redirects&rdnamespace=5 the result is filtered correctly, like here.

In both cases the parameter is parsed and an error is correctly returned when the given id does not belong to any namespace.

Event Timeline

Change 512363 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] API: Apply miser-mode namespace check for generator=redirects

https://gerrit.wikimedia.org/r/512363

Thanks! Is enwiki is miser mode? I looked at meta=siteinfo for misermode and it is neither true nor false but empty-string (which to me suggests false or default, which is also false).

Thanks! Is enwiki is miser mode?

Yes. All Wikimedia wikis are.

I looked at meta=siteinfo for misermode and it is neither true nor false but empty-string (which to me suggests false or default, which is also false).

Originally the Action API was written with XML as the primary format, with the model where a boolean attribute is present when true and absent when false with the value being irrelevant. Since the value is irrelevant, the value used was the empty string.

We have formatversion=2 for the JSON format to have it use proper booleans instead (see https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2), but unfortunately making that the default would break all the existing third-party code that is testing existence.

Ok, thanks for explaining that in detail!

Change 512363 merged by jenkins-bot:
[mediawiki/core@master] API: Apply miser-mode namespace check for generator=redirects

https://gerrit.wikimedia.org/r/512363

Umherirrender triaged this task as Medium priority.
Umherirrender removed a project: Patch-For-Review.