r93359 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93358‎ | r93359 | r93360 >
Date:04:18, 28 July 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added class_exists() check so that absence of Page Schemas extension won't cause problems
Modified paths:
  • /trunk/extensions/SemanticDrilldown/includes/SD_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/includes/SD_Utils.php
@@ -225,13 +225,14 @@
226226 foreach ( $filter_names as $filter_name ) {
227227 $filters[] = SDFilter::load( $filter_name );
228228 }
229 - //Code to read from the pageSchema and return filters
230 - $pageSchemaObj = new PSSchema( $category );
231 - if($pageSchemaObj->isPSDefined()){
232 - //Assuming one Category has a single filter.
233 - $filters_ps = SDFilter::loadAllFromPageSchema( $pageSchemaObj );
234 - $result_filters = array_merge($filters, $filters_ps);
235 - return $result_filters;
 229+ //Code to read from the pageSchema and return filters
 230+ if ( class_exists( 'PSSchema' ) ) {
 231+ $pageSchemaObj = new PSSchema( $category );
 232+ if($pageSchemaObj->isPSDefined()){
 233+ $filters_ps = SDFilter::loadAllFromPageSchema( $pageSchemaObj );
 234+ $result_filters = array_merge($filters, $filters_ps);
 235+ return $result_filters;
 236+ }
236237 }
237238 return $filters;
238239 }