r106400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106399‎ | r106400 | r106401 >
Date:00:18, 16 December 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DataValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php
@@ -104,22 +104,38 @@
105105
106106 // See if this property is a special one, such as e.g. "has type".
107107 $propertyDv = SMWPropertyValue::makeUserProperty( $propertyName );
108 - if ( !$propertyDv->isValid() ) return $propertyDv;
 108+
 109+ if ( !$propertyDv->isValid() ) {
 110+ return $propertyDv;
 111+ }
 112+
109113 $propertyDi = $propertyDv->getDataItem();
110 -
 114+
 115+ // FIXME: this solves the issue of bug 29438, but is probably not what we want to do.
 116+ if ( $propertyDi instanceof SMWDIError ) {
 117+ return $propertyDv;
 118+ }
 119+
111120 $semandticData = self::getSMWData( $parser );
112121
113 - $result = SMWDataValueFactory::newPropertyObjectValue( $propertyDi,
114 - $value, $caption, $semandticData->getSubject() );
 122+ $result = SMWDataValueFactory::newPropertyObjectValue(
 123+ $propertyDi,
 124+ $value,
 125+ $caption,
 126+ $semandticData->getSubject()
 127+ );
115128
116129 if ( $propertyDi->isInverse() ) {
117130 $result->addError( wfMsgForContent( 'smw_noinvannot' ) );
118131 } elseif ( $storeAnnotation && !is_null( self::getSMWData( $parser ) ) ) {
119132 $semandticData->addPropertyObjectValue( $propertyDi, $result->getDataItem() );
 133+
120134 // Take note of the error for storage (do this here and not in storage, thus avoiding duplicates).
121135 if ( !$result->isValid() ) {
122 - $semandticData->addPropertyObjectValue( new SMWDIProperty( '_ERRP' ),
123 - $propertyDi->getDiWikiPage() );
 136+ $semandticData->addPropertyObjectValue(
 137+ new SMWDIProperty( '_ERRP' ),
 138+ $propertyDi->getDiWikiPage()
 139+ );
124140 }
125141 }
126142
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DataValue.php
@@ -445,7 +445,7 @@
446446 *
447447 * @since 1.6
448448 *
449 - * @return SMWDataItem
 449+ * @return SMWDataItem|SMWDIError
450450 */
451451 public function getDataItem() {
452452 if ( $this->isValid() ) {