Legoktm has uploaded a new change for review.

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

Change subject: Fix normalCats warnings
......................................................................

Fix normalCats warnings

Make sure it is defined as an empty array before trying to iterate over
it.

Bug: T148209
Change-Id: Ifd2ae38ee423e36079668fff928ef5bfe624e03d
---
M BlueSkyTemplate.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/78/315978/1

diff --git a/BlueSkyTemplate.php b/BlueSkyTemplate.php
index 1277968..db1f446 100644
--- a/BlueSkyTemplate.php
+++ b/BlueSkyTemplate.php
@@ -1276,6 +1276,7 @@
                                        ] ]
                                ]
                        );
+                       $normalCats = [];
                        foreach ( $res as $row ) {
                                if ( strlen( $row->cat_title ) < 25 ) {
                                        $normalCats[] = $row->cat_title;
@@ -1283,9 +1284,9 @@
                        }
 
                        $catList = '';
-                       if ( count( $normalCats > 0 ) ) {
+                       if ( count( $normalCats ) > 0 ) {
                                $catList = '<ul id="catlist-top">';
-                               foreach ( $normalCats as $category) {
+                               foreach ( $normalCats as $category ) {
                                        $titleSafe = Title::makeTitleSafe( 
NS_CATEGORY, $category );
                                        if ( !$titleSafe ) {
                                                continue;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd2ae38ee423e36079668fff928ef5bfe624e03d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

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

Reply via email to