Page MenuHomePhabricator

Categories with description page but without members aren't in the category table
Closed, DuplicatePublic

Description

Oddly, entries in the category table are only created when a category gets its first member. The creation of a Category: page does not create a row in the category table, but it should. This causes http://www.mediawiki.org/wiki/Talk:API#Generator_.2B_categoryinfo_bug


Version: 1.14.x
Severity: enhancement

Details

Reference
bz15321

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:17 PM
bzimport added a project: MediaWiki-Categories.
bzimport set Reference to bz15321.
bzimport added a subscriber: Unknown Object (MLST).
Catrope created this task.Aug 26 2008, 12:56 PM
Lupo added a comment.Oct 18 2011, 6:57 AM

This bug is still present in 1.18. Witness the two queries:

http://commons.wikimedia.org/w/api.php?action=query&prop=info|links|categories|categoryinfo&plnamespace=14&pllimit=10&cllimit=10&format=jsonfm&titles=Category:PD-VAR

PD-VAR is a category with an existing category page, but without any category members. The API does not return any categoryinfo.

http://commons.wikimedia.org/w/api.php?action=query&prop=info|links|categories|categoryinfo&plnamespace=14&pllimit=10&cllimit=10&format=jsonfm&titles=Category:PD_Finland

Same query with PD_Finland, a category with members: the API does return categoryinfo.

This is causing a subtle bug in HotCat, which uses categoryinfo to figure out whether a category is a HIDDENCAT. Both categories are hidden, but since only one returns a categoryinfo, HotCat sees only one of them as hidden.

The workaround for HotCat would be a bit convoluted: get the contents of MediaWiki:Hidden-category-category, then check whether the category specified by this system message is in the categories of the checked category. Unfortunately, getting MediaWiki:Hidden-category-category would be one remote request more...