mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-23 15:36:52 +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();
|
||||
|
||||
// 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 ) {
|
||||
try {
|
||||
$catName = $this->categoryManager->getCategoryName( $row->linter_cat );
|
||||
} catch ( MissingCategoryException $e ) {
|
||||
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;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue