r112754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112753‎ | r112754 | r112755 >
Date:01:21, 1 March 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
MFT r112751

Prequisite to poking further:

2 PHP Warning: get_object_vars() expects parameter 1 to be object, null given in /usr/local/apache/common-local/php-1.19/extensions/CategoryTree/CategoryTreeFunctions.php on line 201
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/CategoryTree (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -166,25 +166,11 @@
167167 $outputPage->addModules( 'ext.categoryTree' );
168168 }
169169
170 - /**
171 - * @return Services_JSON
172 - */
173 - static function getJsonCodec() {
174 - static $json = null;
175 -
176 - if ( !$json ) {
177 - $json = new Services_JSON(); # recycle API's JSON codec implementation
178 - }
179 -
180 - return $json;
181 - }
182 -
183170 static function encodeOptions( $options, $enc ) {
184171 if ( $enc == 'mode' || $enc == '' ) {
185172 $opt = $options['mode'];
186173 } elseif ( $enc == 'json' ) {
187 - $json = self::getJsonCodec(); // XXX: this may be a bit heavy...
188 - $opt = $json->encode( $options );
 174+ $opt = FormatJson::encode( $options );
189175 } else {
190176 throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc );
191177 }
@@ -196,8 +182,7 @@
197183 if ( $enc == 'mode' || $enc == '' ) {
198184 $opt = array( "mode" => $options );
199185 } elseif ( $enc == 'json' ) {
200 - $json = self::getJsonCodec(); // XXX: this may be a bit heavy...
201 - $opt = $json->decode( $options );
 186+ $opt = FormatJson::decode( $options );
202187 $opt = get_object_vars( $opt );
203188 } else {
204189 throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc );
Property changes on: branches/wmf/1.19wmf1/extensions/CategoryTree/CategoryTreeFunctions.php
___________________________________________________________________
Modified: svn:mergeinfo
205190 Merged /trunk/extensions/CategoryTree/CategoryTreeFunctions.php:r112751
Property changes on: branches/wmf/1.19wmf1/extensions/CategoryTree
___________________________________________________________________
Added: svn:mergeinfo
206191 Merged /branches/sqlite/extensions/CategoryTree:r58211-58321
207192 Merged /trunk/phase3/extensions/CategoryTree:r111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
208193 Merged /branches/new-installer/phase3/extensions/CategoryTree:r43664-66004
209194 Merged /branches/JSTesting/extensions/CategoryTree:r100352-107913
210195 Merged /branches/REL1_15/phase3/extensions/CategoryTree:r51646
211196 Merged /branches/wmf/1.18wmf1/extensions/CategoryTree:r97508
212197 Merged /branches/REL1_17/phase3/extensions/CategoryTree:r81445,81448
213198 Merged /trunk/extensions/CategoryTree:r111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112153,112160,112166,112260,112282,112360,112517,112571,112613,112628,112751

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112751Don't explicitly use Services_JSON, use FormatJsonreedy01:17, 1 March 2012

Comments

#Comment by Reedy (talk | contribs)   01:24, 1 March 2012

Now:

PHP Warning:  get_object_vars() expects parameter 1 to be object, null given in /usr/local/apache/common-local/php-1.19/extensions/CategoryTree/CategoryTreeFunctions.php on line 186

Status & tagging log