X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategory.php;h=28b566a7f99ff2dd6f3b0cef13edea93ec7db130;hb=c6defb358df6c01398bc75d131acb0fbcc9e899d;hp=6209a1a9eab3c97e373e7d47c95755917e457883;hpb=601519ee36462faabacf4547c9aefaf7e8726476;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Category.php b/includes/Category.php index 6209a1a9ea..28b566a7f9 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -95,7 +95,11 @@ class Category { # and should not be kept, and 2) we *probably* don't have to scan many # rows to obtain the correct figure, so let's risk a one-time recount. if ( $this->mPages < 0 || $this->mSubcats < 0 || $this->mFiles < 0 ) { - $this->refreshCounts(); + $this->mPages = max( $this->mPages, 0 ); + $this->mSubcats = max( $this->mSubcats, 0 ); + $this->mFiles = max( $this->mFiles, 0 ); + + DeferredUpdates::addCallableUpdate( [ $this, 'refreshCounts' ] ); } return true;