Special:PagesWithProp: Fix PHP notice if no page properties are present
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 26 Jul 2013 06:24:06 +0000 (08:24 +0200)
committerMatmarex <matma.rex@gmail.com>
Fri, 26 Jul 2013 10:32:03 +0000 (10:32 +0000)
Always declare $propnames as an array; do not assume that there will
be a property to implicitly set it.

Bug: 51891
Change-Id: I82c6b71a3283c7dc17e66873c2e54cea973c67c0

RELEASE-NOTES-1.22
includes/specials/SpecialPagesWithProp.php

index f996204..d6204a7 100644 (file)
@@ -227,6 +227,8 @@ production.
   the function apache_request_headers() function is not available.
 * (bug 33399) LivePreview: Re-run wikipage content handlers
   (jquery.makeCollapsible, jquery.tablesorter) after preview content is loaded.
+* (bug 51891) Fixed PHP notice on Special:PagesWithProp when no properties
+  are defined.
 
 === API changes in 1.22 ===
 * (bug 25553) The JSON output formatter now leaves forward slashes unescaped
index 27331e5..199c5cd 100644 (file)
@@ -54,6 +54,7 @@ class SpecialPagesWithProp extends QueryPage {
                        __METHOD__,
                        array( 'DISTINCT', 'ORDER BY' => 'pp_propname' )
                );
+               $propnames = array();
                foreach ( $res as $row ) {
                        $propnames[$row->pp_propname] = $row->pp_propname;
                }