I lately switched Commons coordinate template https://commons.wikimedia.org/wiki/Template:Location from using dozens of subtemplates to much cleaner Lua code. Everything works great, except for Special:WhatLinksHere links. The no longer used subtemplates like https://commons.wikimedia.org/wiki/Template:Location/layout still show over 3M files transcluding it and files, like https://commons.wikimedia.org/wiki/File:Estadio_Pacaembu.jpg which still claims to transclude [[Template:Location/layout]] ("Templates used on this page:" section in edit mode). The transclusion dependencies do not correct themselves even with a Purge, but page edit fixes it. Also several times I got some sort of internal database errors when using Special:WhatLinksHere.
In the past when I run into this kind of trouble I waited, but in some cases it took over half a year for the database to update itself. In other cases those issues never clear (or I did not wait long enough), like with Category:Pages with malformed coordinate tags https://commons.wikimedia.org/wiki/Category:Pages_with_malformed_coordi nate_tags , which due to a long fixed bug in {{#coordinates: https://www.mediawiki.org/wiki/Extension:GeoData }} was filled with 40k files which did not have any issues. Then the only solution I know is Pywikibot/touch.py (https://www.mediawiki.org/wiki/Manual:Pywikipediabot/touch.py ), which I recently used to clear {{#coordinates: https://www.mediawiki.org/wiki/Extension:GeoData }} issues.
Is there a better way to synchronize database with reality?
Jarek T.
(user:jarekt http://commons.wikimedia.org/wiki/User:Jarekt )