Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/177982

Change subject: Ensure integer compare in Special:WantedCategories
......................................................................

Ensure integer compare in Special:WantedCategories

For some reasons the qc_value from the query is returned as string, not
integer. The strict unequal comparision gives always true and that
results in unneded "1 -> 1 member". Added a intval.

Bug: T76910
Change-Id: I26e2718e418f35e2e10565c747a8f06f2bbb5ba3
---
M includes/specials/SpecialWantedcategories.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/177982/1

diff --git a/includes/specials/SpecialWantedcategories.php 
b/includes/specials/SpecialWantedcategories.php
index b8c0bb2..7ddafae 100644
--- a/includes/specials/SpecialWantedcategories.php
+++ b/includes/specials/SpecialWantedcategories.php
@@ -109,6 +109,7 @@
                        $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 ) {
@@ -116,11 +117,11 @@
                        }
 
                        // 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();
                        }
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/177982
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26e2718e418f35e2e10565c747a8f06f2bbb5ba3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to