r86826 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86825‎ | r86826 | r86827 >
Date:17:40, 24 April 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for SMW 1.6
Modified paths:
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php
@@ -18,7 +18,13 @@
1919 }
2020
2121 public function addPropertyAndValue( $propName, $value ) {
22 - $property = SMWPropertyValue::makeUserProperty( $propName );
 22+ // SMW 1.6+
 23+ if ( class_exists( 'SMWDIProperty' ) ) {
 24+ $property = new SMWDIProperty( $propName );
 25+ } else {
 26+ $property = SMWPropertyValue::makeUserProperty( $propName );
 27+ }
 28+
2329 $dataValue = SMWDataValueFactory::newPropertyObjectValue( $property, $value );
2430 if ( $dataValue->isValid() ) {
2531 $this->mPropertyValuePairs[] = array( $property, $dataValue );

Status & tagging log