r110206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110205‎ | r110206 | r110207 >
Date:12:19, 28 January 2012
Author:ashley
Status:ok
Tags:
Comment:
SocialProfile: fix Fatal error: Cannot access private property SystemGifts::$categories in ..\extensions\SocialProfile\SystemGifts\SpecialSystemGiftManager.php on line 156 by creating an accessor for SystemGifts::$categories and using it in SpecialSystemGiftManager.php
Modified paths:
  • /trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php (modified) (history)
  • /trunk/extensions/SocialProfile/SystemGifts/SystemGiftsClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
@@ -153,7 +153,7 @@
154154 <td width="695">
155155 <select name="gift_category">' . "\n";
156156 $g = new SystemGifts();
157 - foreach ( $g->categories as $category => $id ) {
 157+ foreach ( $g->getCategories() as $category => $id ) {
158158 $sel = '';
159159 if ( isset( $gift['gift_category'] ) && $gift['gift_category'] == $id ) {
160160 $sel = ' selected="selected"';
Index: trunk/extensions/SocialProfile/SystemGifts/SystemGiftsClass.php
@@ -26,6 +26,14 @@
2727 );
2828
2929 /**
 30+ * Accessor for the private $categories variable; used by
 31+ * SpecialSystemGiftManager.php at least.
 32+ */
 33+ public function getCategories() {
 34+ return $this->categories;
 35+ }
 36+
 37+ /**
3038 * Adds awards for all registered users, updates statistics and purges
3139 * caches.
3240 * Special:PopulateAwards calls this function

Status & tagging log