mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-27 17:20:12 +00:00
Don't include hidden category counts in page info
Bug: T337275 Bug: T334527 Change-Id: I6439df894c06fc5592422e72dac04150591f4033
This commit is contained in:
parent
632d7095d8
commit
397b36e8e3
|
@ -353,16 +353,21 @@ class Database {
|
||||||
->fetchResultSet();
|
->fetchResultSet();
|
||||||
|
|
||||||
// Initialize zero values
|
// Initialize zero values
|
||||||
$ret = array_fill_keys( $this->categoryManager->getVisibleCategories(), 0 );
|
$categories = $this->categoryManager->getVisibleCategories();
|
||||||
|
$ret = array_fill_keys( $categories, 0 );
|
||||||
foreach ( $rows as $row ) {
|
foreach ( $rows as $row ) {
|
||||||
try {
|
try {
|
||||||
$catName = $this->categoryManager->getCategoryName( $row->linter_cat );
|
$catName = $this->categoryManager->getCategoryName( $row->linter_cat );
|
||||||
} catch ( MissingCategoryException $e ) {
|
} catch ( MissingCategoryException $e ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Only set visible categories. Alternatively, we could add another
|
||||||
|
// where clause to the selection above.
|
||||||
|
if ( !in_array( $catName, $categories, true ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$ret[$catName] = (int)$row->count;
|
$ret[$catName] = (int)$row->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue