X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWantedcategories.php;h=7ddafae40e682170f1fe3df694625ba93d5c57b0;hb=21e83e5d562b7a0efaa1afe46574c8d8cd0f51f5;hp=51d9af3fa195173ab6c4f6c5dd0b16e2b0d15b59;hpb=d5e4bea76b0a68479510904db622edfd65255afd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWantedcategories.php b/includes/specials/SpecialWantedcategories.php index 51d9af3fa1..7ddafae40e 100644 --- a/includes/specials/SpecialWantedcategories.php +++ b/includes/specials/SpecialWantedcategories.php @@ -38,9 +38,11 @@ class WantedCategoriesPage extends WantedQueryPage { function getQueryInfo() { return array( 'tables' => array( 'categorylinks', 'page' ), - 'fields' => array( 'namespace' => NS_CATEGORY, - 'title' => 'cl_to', - 'value' => 'COUNT(*)' ), + 'fields' => array( + 'namespace' => NS_CATEGORY, + 'title' => 'cl_to', + 'value' => 'COUNT(*)' + ), 'conds' => array( 'page_title IS NULL' ), 'options' => array( 'GROUP BY' => 'cl_to' ), 'join_conds' => array( 'page' => array( 'LEFT JOIN', @@ -73,7 +75,7 @@ class WantedCategoriesPage extends WantedQueryPage { __METHOD__ ); foreach ( $categoryRes as $row ) { - $this->currentCategoryCounts[ $row->cat_title ] = intval( $row->cat_pages ); + $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages ); } // Back to start for display @@ -104,9 +106,10 @@ class WantedCategoriesPage extends WantedQueryPage { } else { $plink = Linker::link( $nt, $text ); - $currentValue = isset( $this->currentCategoryCounts[ $result->title ] ) - ? $this->currentCategoryCounts[ $result->title ] + $currentValue = isset( $this->currentCategoryCounts[$result->title] ) + ? $this->currentCategoryCounts[$result->title] : 0; + $cachedValue = intval( $result->value ); // T76910 // If the category has been created or emptied since the list was refreshed, strike it if ( $nt->isKnown() || $currentValue === 0 ) { @@ -114,11 +117,11 @@ class WantedCategoriesPage extends WantedQueryPage { } // Show the current number of category entries if it changed - if ( $currentValue !== $result->value ) { + if ( $currentValue !== $cachedValue ) { $nlinks = $this->msg( 'nmemberschanged' ) - ->numParams( $result->value, $currentValue )->escaped(); + ->numParams( $cachedValue, $currentValue )->escaped(); } else { - $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped(); + $nlinks = $this->msg( 'nmembers' )->numParams( $cachedValue )->escaped(); } }