Last modified: 2014-07-20 13:05:09 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 T50824, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48824 - Creating a page in category namespace does not insert row in category table.
Creating a page in category namespace does not insert row in category table.
Status: NEW
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 65149
  Show dependency treegraph
 
Reported: 2013-05-26 08:09 UTC by Merlijn van Deen (test)
Modified: 2014-07-20 13:05 UTC (History)
6 users (show)

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


Attachments

Description Merlijn van Deen (test) 2013-05-26 08:09:13 UTC
Example: http://commons.wikimedia.org/wiki/Category:Cultural_heritage_monuments_in_Dari%C3%A9n_Province

This category was created by BotMultichill to extend the category tree. However, querying it using the api will not show the category:

http://commons.wikimedia.org/w/api.php?action=query&list=allcategories&acprop=hidden&acfrom=Cultural%20heritage%20monuments%20in%20Dari

This happens because, while there /is/ a Page row:
mysql> select * from page where page_namespace=14 and  page_title>="Cultural_heritage_monuments_in_Dari" limit 1;
+----------+----------------+-------------------------------------------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+-----------------------+
| page_id  | page_namespace | page_title                                      | page_restrictions | page_counter | page_is_redirect | page_is_new | page_random    | page_touched   | page_latest | page_len | page_no_title_convert |
+----------+----------------+-------------------------------------------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+-----------------------+
| 21211737 |             14 | Cultural_heritage_monuments_in_Darién_Province  |                   |            0 |                0 |           1 | 0.721362456992 | 20130526075638 |    77704695 |      125 |                     0 |
+----------+----------------+-------------------------------------------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+-----------------------+


there is no entry in the category table:
mysql> select * from category where cat_title>="Cultural_heritage_monuments_in_Dari" limit 1;
+----------+------------------------------------------+-----------+-------------+-----------+------------+
| cat_id   | cat_title                                | cat_pages | cat_subcats | cat_files | cat_hidden |
+----------+------------------------------------------+-----------+-------------+-----------+------------+
| 64836847 | Cultural_heritage_monuments_in_Darmstadt |        17 |           2 |        15 |          0 |
+----------+------------------------------------------+-----------+-------------+-----------+------------+

While, in general, empty categories *do* show up in the result - as long as they have had a page in them in the past.

So, as far as I can see, two things have to be addressed in a patch:
  1) when a new page in category namespace is created, a row in the category table should be inserted
  2) the category namespace should be scanned for missing entries in the category table, and those should be added.
Comment 1 Andre Klapper 2013-06-03 15:44:01 UTC
Brad: Any chance you could take a look at it (or any idea who to ask instead)? Thanks in advance.
Comment 2 Brad Jorsch 2013-06-03 16:50:00 UTC
Merlijn's analysis is basically correct. I only have two things to add:
1. This is not limited to the API, it also applies to Special:Categories. See https://commons.wikimedia.org/wiki/Special:Categories/Cultural_heritage_monuments_in_Dari
2. This is actually the documented behavior, although I don't know whether that documentation exists outside of comments in maintenance/tables.sql: the definition of an existing category is that it at some point had a page in it, regardless of whether a corresponding page in namespace 14 exists or ever existed.

The question is whether this is just bug 1 (improve the documentation) or if the definition of "category" should be changed as suggested. I see no particular reason not to change the definition besides "it's more work", but others might know more about the situation than I do.
Comment 3 Andre Klapper 2013-06-04 13:22:45 UTC
(In reply to comment #2)
> 2. This is actually the documented behavior

Oh I see. Thanks for elaborating! Lowering priority.
Comment 4 db [inactive,noenotif] 2014-03-01 22:01:26 UTC
To query all existing categories, it is possible to use allpages with apnamespace=14

But when a category contains at least one page and that page was removed, it will still be shown on allcategories, but can be filtered by acmin=1 (bug 26411)
Comment 5 Bawolff (Brian Wolff) 2014-03-02 02:31:49 UTC
Changing the definition sounds fine to me.

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


Navigation
Links