r80805 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80804‎ | r80805 | r80806 >
Date:10:29, 23 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Add missing global

Move loop into if where $res is defined
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.db.php (modified) (history)
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -84,7 +84,7 @@
8585
8686 function efCentralNoticeSetup() {
8787 global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages;
88 - global $wgCentralNoticeLoader;
 88+ global $wgCentralNoticeLoader, $wgSpecialPageGroups;
8989
9090 $dir = dirname( __FILE__ ) . '/';
9191
Index: trunk/extensions/CentralNotice/CentralNotice.db.php
@@ -126,6 +126,8 @@
127127
128128 $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
129129
 130+ $templates = array();
 131+
130132 if ( $campaigns ) {
131133 // Pull templates based on join with assignments
132134 $res = $dbr->select(
@@ -150,16 +152,16 @@
151153 'GROUP BY' => 'tmp_name'
152154 )
153155 );
 156+
 157+ foreach ( $res as $row ) {
 158+ $templates[] = array(
 159+ 'name' => $row->tmp_name,
 160+ 'weight' => intval( $row->total_weight ),
 161+ 'display_anon' => intval( $row->tmp_display_anon ),
 162+ 'display_account' => intval( $row->tmp_display_account ),
 163+ );
 164+ }
154165 }
155 - $templates = array();
156 - foreach ( $res as $row ) {
157 - $templates[] = array(
158 - 'name' => $row->tmp_name,
159 - 'weight' => intval( $row->total_weight ),
160 - 'display_anon' => intval( $row->tmp_display_anon ),
161 - 'display_account' => intval( $row->tmp_display_account ),
162 - );
163 - }
164166 return $templates;
165167 }
166168

Follow-up revisions

RevisionCommit summaryAuthorDate
r91115MFT r76455, r80805 and r83564-91107awjrichards21:53, 29 June 2011

Status & tagging log