Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -64,13 +64,24 @@ |
65 | 65 | return; |
66 | 66 | } |
67 | 67 | $store = smwfGetStore(); |
68 | | - $data = $store->getSemanticData( $title ); |
| 68 | + if ( class_exists( 'SMWDataItem' ) ) { |
| 69 | + $value = SMWDIWikiPage::newFromTitle( $title ); |
| 70 | + } else { |
| 71 | + $value = $title; |
| 72 | + } |
| 73 | + $data = $store->getSemanticData( $value ); |
69 | 74 | foreach ( $data->getProperties() as $property ) { |
70 | 75 | $propertyValues = $data->getPropertyValues( $property ); |
71 | 76 | foreach ( $propertyValues as $propertyValue ) { |
72 | | - if ( $propertyValue instanceof SMWWikiPageValue ) { |
| 77 | + $linkedPageName = null; |
| 78 | + if ( $propertyValue instanceof SMWDIWikiPage ) { |
| 79 | + $propertyName = $property->getKey(); |
| 80 | + $linkedPageName = $propertyValue->getDBkey(); |
| 81 | + } elseif ( $propertyValue instanceof SMWWikiPageValue ) { |
73 | 82 | $propertyName = $property->getWikiValue(); |
74 | 83 | $linkedPageName = $propertyValue->getWikiValue(); |
| 84 | + } |
| 85 | + if ( !is_null( $linkedPageName ) ) { |
75 | 86 | if ( array_key_exists( $linkedPageName, self::$mLinkedPages ) ) { |
76 | 87 | self::$mLinkedPages[$linkedPageName][] = $propertyName; |
77 | 88 | } else { |
— | — | @@ -256,7 +267,13 @@ |
257 | 268 | if ( in_array( 'broken', $options ) ) { |
258 | 269 | global $sfgRedLinksCheckOnlyLocalProps; |
259 | 270 | if ( $sfgRedLinksCheckOnlyLocalProps ) { |
260 | | - self::getPagePropertiesOfPage( $linker->getTitle() ); |
| 271 | + if ( $linker instanceof DummyLinker ) { |
| 272 | + global $wgTitle; |
| 273 | + $curTitle = $wgTitle; |
| 274 | + } else { |
| 275 | + $curTitle = $linker->getTitle(); |
| 276 | + } |
| 277 | + self::getPagePropertiesOfPage( $curTitle ); |
261 | 278 | $targetName = $target->getText(); |
262 | 279 | if ( array_key_exists( $targetName, self::$mLinkedPages ) ) { |
263 | 280 | $incoming_properties = self::$mLinkedPages[$targetName]; |