Last modified: 2009-01-14 17:05:15 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 T18844, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16844 - API: Add parameter clcategory to prop=categories
API: Add parameter clcategory to prop=categories
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.14.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php?act...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-30 23:24 UTC by P.Copp
Modified: 2009-01-14 17:05 UTC (History)
4 users (show)

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


Attachments

Description P.Copp 2008-12-30 23:24:37 UTC
Sometimes you simply want to know whether some pages are in a given category or not. For these use cases, currently you have to query prop=categories, which will give you all categories for each page. Even worse, if you have more than one category per page in average, you will probably hit the (cl)limit for the query, and have to do a (perhaps sub-)query-continue, which will again give you lots of stuff that you actually don't need.

So an option like clcategory=Category:Foo would be nice, which will return at most one category per page and so one wouldn't have to care about hitting the limit.
Comment 1 Gurch 2008-12-30 23:51:05 UTC
Yeah, it's a rather odd construct but this would be of use; I can think of a few applications for it. Even more so if clcategory can be a pipe-delimited list of categories such that only those are returned.
Comment 2 Roan Kattouw 2009-01-04 22:29:41 UTC
This is probably doable database-wise, although I'm not sure which type of request the DB likes best: one title with multiple cats or one category with multiple titles. In the latter case, this feature would be better off as a cmtitles parameter to list=categorymembers. Also, I'm afraid that combining multiple titles with multiple categories may not be doable.

I'll look into this again when I can, but I'll probably be busy for the next two weeks.
Comment 3 Gurch 2009-01-04 23:59:40 UTC
(In reply to comment #2)
> Also, I'm afraid that combining multiple titles with multiple
> categories may not be doable.

I suspected that might be the case :) -- don't worry about it.
Comment 4 Roan Kattouw 2009-01-14 17:05:15 UTC
Added in r45733. Multiple pages and multiple cats turned out to be no problem; you can even combine them.

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


Navigation
Links