Exclude null rows from Special:MediaStatistics
authorBrian Wolff <bawolff+wn@gmail.com>
Wed, 25 Feb 2015 22:23:46 +0000 (18:23 -0400)
committerBrian Wolff <bawolff+wn@gmail.com>
Wed, 25 Feb 2015 22:23:46 +0000 (18:23 -0400)
The commons db has a random null row in the image table, adding
a non-sensical row to this report.

Bug: T74535
Change-Id: Ie290e588af56aee7d5303954202f7923b64d2272

includes/specials/SpecialMediaStatistics.php

index 1056cda..b62de5d 100644 (file)
@@ -73,6 +73,10 @@ class MediaStatisticsPage extends QueryPage {
                                'namespace' => NS_MEDIA, /* needs to be something */
                                'value' => '1'
                        ),
+                       'conds' => array(
+                               // WMF has a random null row in the db
+                               'img_media_type IS NOT NULL'
+                       ),
                        'options' => array(
                                'GROUP BY' => array(
                                        'img_media_type',