Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php |
— | — | @@ -152,7 +152,12 @@ |
153 | 153 | * internal object into the database. |
154 | 154 | */ |
155 | 155 | function getStorageSQL( $internalObject ) { |
156 | | - $ioID = $this->makeSMWPageID( $internalObject->getName(), $internalObject->getNamespace(), '' ); |
| 156 | + if ( method_exists( 'SMWDIWikiPage', 'getSubobjectName' ) ) { |
| 157 | + // SMW 1.6 |
| 158 | + $ioID = $this->makeSMWPageID( $internalObject->getName(), $internalObject->getNamespace(), '', '' ); |
| 159 | + } else { |
| 160 | + $ioID = $this->makeSMWPageID( $internalObject->getName(), $internalObject->getNamespace(), '' ); |
| 161 | + } |
157 | 162 | $upRels2 = array(); |
158 | 163 | $upAtts2 = array(); |
159 | 164 | $upText2 = array(); |
— | — | @@ -168,10 +173,16 @@ |
169 | 174 | $isCoords = ( $tableid == 'smw_coords' ); |
170 | 175 | |
171 | 176 | if ( $isRelation ) { |
| 177 | + if ( method_exists( 'SMWDIWikiPage', 'getSubobjectName' ) ) { |
| 178 | + // SMW 1.6 |
| 179 | + $mainPageID = $this->makeSMWPageID( $value->getDBkey(), $value->getNamespace(), $value->getInterwiki(), '' ); |
| 180 | + } else { |
| 181 | + $mainPageID = $this->makeSMWPageID( $value->getDBkey(), $value->getNamespace(), $value->getInterwiki() ); |
| 182 | + } |
172 | 183 | $upRels2[] = array( |
173 | 184 | 's_id' => $ioID, |
174 | 185 | 'p_id' => $this->makeSMWPropertyID( $property ), |
175 | | - 'o_id' => $this->makeSMWPageID( $value->getDBkey(), $value->getNamespace(), $value->getInterwiki() ) |
| 186 | + 'o_id' => $mainPageID |
176 | 187 | ); |
177 | 188 | } elseif ( $isAttribute ) { |
178 | 189 | if ( class_exists( 'SMWCompatibilityHelpers' ) ) { |