From 9b61538e92dc59ff7a24ca59a0e1e5d96ab85450 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 26 Jul 2013 08:24:06 +0200 Subject: [PATCH] Special:PagesWithProp: Fix PHP notice if no page properties are present 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 | 2 ++ includes/specials/SpecialPagesWithProp.php | 1 + 2 files changed, 3 insertions(+) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index f996204b85..d6204a7632 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -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 diff --git a/includes/specials/SpecialPagesWithProp.php b/includes/specials/SpecialPagesWithProp.php index 27331e5d63..199c5cdeac 100644 --- a/includes/specials/SpecialPagesWithProp.php +++ b/includes/specials/SpecialPagesWithProp.php @@ -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; } -- 2.20.1