Category talk:Ancient Chinese characters by component

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Bug report - #ifexist updates[edit]

Hello (technical discussion ahead, sorry for that).

I just created the Template:ACCcategorsation which works as a "subroutine" to Template:ACClicense ‎ - it takes two parameters (for instance, "seal" and "豕") and tests for the existence of a subcategory using {{#ifexist: category:ACC containing {{{1|}}}-{{{2|}}} | , that is to say with my example:

This is meant to allow the Template:ACClicense ‎ (ACC = Ancient Chineese Character) to categorise a chineese character according to its various components, inside the Category:Ancient Chinese characters by components subcategories, without knowing in advance whether subcategories exist for such or such style (seal / bigseal / bronze / oracle / ...) and such and such character component. And, of course, subcategories may be opened when the parent category becomes too crowded

My problem is, to work corectly, that #ifexist: should be evaluated in three different cases :

  • Obviously it is (correctly) evaluated when a new file is uploaded and described through the ACClicense template.
  • It is also (correctly) evaluated when the ACClicense is modified, apparently causing all files usig that model to be (slowly) re-evaluated. This was the problem described in Commons:Village pump/Archive/2013/06#Bug report - category modification and Bugzilla Bug 50135, and it seems to have been correctly solved.
  • But when a previously non-existent sub-category is created, causing some #ifexist: tests to change result, the corresponding file indexations are not ubdated and the new category remains empty. The only way to force a re-examination of their case seems to be to make some apparent modification to the ACClicense template and force a reevaluation on all the files using that template (3000+ files so far).

Is there a way of updating the template instantation specifically when non-existent files tested for in a #ifexist: test are created ?

Thanks in advance for your suggestions, Michelet-密是力 (talk) 13:51, 15 December 2014 (UTC)[reply]

Hmm, when a category is created, it will re-parse all the relavent pages (updating the display), but it won't do links update (update the categories). What you can do, is any time you create one of these categories, go to the url https://commons.wikimedia.org/w/api.php?action=purge&generator=backlinks&gbllimit=max&forcelinkupdate=true&gbltitle=Category:ACC_containing_bigseal-??? (replacing the Category:ACC_containing_bigseal-??? at the end of the url with whatever category you just created). That should force all the things that are doing #ifexist: for that category to re-evaluate what categories they should be in. Bawolff (talk) 18:56, 15 December 2014 (UTC)[reply]
It works ! sounds like black magik to me, but thanks a lot. Michelet-密是力 (talk) 07:44, 16 December 2014 (UTC)[reply]