Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php |
— | — | @@ -104,22 +104,38 @@ |
105 | 105 | |
106 | 106 | // See if this property is a special one, such as e.g. "has type". |
107 | 107 | $propertyDv = SMWPropertyValue::makeUserProperty( $propertyName ); |
108 | | - if ( !$propertyDv->isValid() ) return $propertyDv; |
| 108 | + |
| 109 | + if ( !$propertyDv->isValid() ) { |
| 110 | + return $propertyDv; |
| 111 | + } |
| 112 | + |
109 | 113 | $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 | + |
111 | 120 | $semandticData = self::getSMWData( $parser ); |
112 | 121 | |
113 | | - $result = SMWDataValueFactory::newPropertyObjectValue( $propertyDi, |
114 | | - $value, $caption, $semandticData->getSubject() ); |
| 122 | + $result = SMWDataValueFactory::newPropertyObjectValue( |
| 123 | + $propertyDi, |
| 124 | + $value, |
| 125 | + $caption, |
| 126 | + $semandticData->getSubject() |
| 127 | + ); |
115 | 128 | |
116 | 129 | if ( $propertyDi->isInverse() ) { |
117 | 130 | $result->addError( wfMsgForContent( 'smw_noinvannot' ) ); |
118 | 131 | } elseif ( $storeAnnotation && !is_null( self::getSMWData( $parser ) ) ) { |
119 | 132 | $semandticData->addPropertyObjectValue( $propertyDi, $result->getDataItem() ); |
| 133 | + |
120 | 134 | // Take note of the error for storage (do this here and not in storage, thus avoiding duplicates). |
121 | 135 | if ( !$result->isValid() ) { |
122 | | - $semandticData->addPropertyObjectValue( new SMWDIProperty( '_ERRP' ), |
123 | | - $propertyDi->getDiWikiPage() ); |
| 136 | + $semandticData->addPropertyObjectValue( |
| 137 | + new SMWDIProperty( '_ERRP' ), |
| 138 | + $propertyDi->getDiWikiPage() |
| 139 | + ); |
124 | 140 | } |
125 | 141 | } |
126 | 142 | |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DataValue.php |
— | — | @@ -445,7 +445,7 @@ |
446 | 446 | * |
447 | 447 | * @since 1.6 |
448 | 448 | * |
449 | | - * @return SMWDataItem |
| 449 | + * @return SMWDataItem|SMWDIError |
450 | 450 | */ |
451 | 451 | public function getDataItem() { |
452 | 452 | if ( $this->isValid() ) { |