Page MenuHomePhabricator

Counter of the numbers of the pages on a category shows negative result
Closed, ResolvedPublic


On the Hungarian Wikipedia's recent changes ("friss változtatások") page there is a counter which shows the number of the pages on the candidates for speedy deletion category ("Azonnali törlésre váró lapok"). As you can see on the picture, sometimes it shows a negative number which is obviously wrong. How is it possible that it shows a negative number? Is it possible to fix it?

Képkivágás.PNG (757×1 px, 131 KB)

Event Timeline

This is probably because {{#expr:{{PAGESINCATEGORY}} ... is not properly written, so when doing the count, it displays a negative number.

({{#expr:{{PAGESINCATEGORY:Azonnali törlésre váró lapok}}-{{PAGESINCATEGORY:Azonnali törlésre váró lapok|subcats}}}})]]

@MarcoAurelio If I think well we cannot fix it locally, right?

@Bencemac I am not sure either. Someone with more deep knowledge will look at your report and update you with what needs to be done.

The numbers of pages in categories are occasionally a bit off, mostly because the code updating them is not very reliable in case of race conditions or exceptions happening in the middle of the processing. If they ever get negative, viewing the category page should trigger recalculation of the count (this is actually special-cased). See T18036 for a longer discussion about inaccurate category counts.

We need to run recountCategories.php on huwiki. (See also T170737)

I'll look into doing that.

Mentioned in SAL (#wikimedia-operations) [2018-05-02T16:35:55Z] <bawolff> run recountCategories.php on huwiki T169964

And done.

Wow, that was much faster then i thought

@Bencemac can you confirm this is fixed now

[Note: Categories with lots of deletions suffer count drift at a high rate, so its entirely possible to get out of sync again later on]

@Bawolff Thanks! I cannot find any, so probably it solved the problem.