r97791 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97790‎ | r97791 | r97792 >
Date:04:19, 22 September 2011
Author:yaron
Status:deferred (Comments)
Tags:
Comment:
Added check of Page Schemas form declaration to getDefaultFormsForPage()
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormLinker.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php
@@ -311,6 +311,14 @@
312312 $default_forms = array();
313313 $categories = SFUtils::getCategoriesForPage( $title );
314314 foreach ( $categories as $category ) {
 315+ // Check the Page Schema, if one exists.
 316+ $psSchema = new PSSchema( $category );
 317+ if ( $psSchema->isPSDefined() ) {
 318+ $formName = SFPageSchemas::getFormName( $psSchema );
 319+ if ( !is_null( $formName ) ) {
 320+ $default_forms[] = $formName;
 321+ }
 322+ }
315323 $default_forms = array_merge( $default_forms, self::getFormsThatPagePointsTo( $category, NS_CATEGORY, self::DEFAULT_FORM ) );
316324 }
317325 if ( count( $default_forms ) > 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r97803Fix for r97791 - class_exists() check added for Page Schemasyaron08:15, 22 September 2011

Comments

#Comment by Raymond (talk | contribs)   07:26, 22 September 2011
PHP Fatal error: Class 'PSSchema' not found in /www/w/extensions/SemanticForms/includes/SF_FormLinker.php on line 315
#Comment by Yaron Koren (talk | contribs)   08:15, 22 September 2011

Oops! Thanks for testing that, and pointing out the bug. This is now fixed.

Status & tagging log