Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -266,18 +266,21 @@ |
267 | 267 | |
268 | 268 | global $sfgRedLinksCheckOnlyLocalProps; |
269 | 269 | if ( $sfgRedLinksCheckOnlyLocalProps ) { |
| 270 | + $incoming_properties = array(); |
270 | 271 | if ( $linker instanceof DummyLinker ) { |
271 | 272 | global $wgTitle; |
272 | 273 | $curTitle = $wgTitle; |
273 | 274 | } else { |
274 | 275 | $curTitle = $linker->getTitle(); |
275 | 276 | } |
276 | | - self::getPagePropertiesOfPage( $curTitle ); |
277 | | - $targetName = $target->getText(); |
278 | | - if ( array_key_exists( $targetName, self::$mLinkedPages ) ) { |
279 | | - $incoming_properties = self::$mLinkedPages[$targetName]; |
280 | | - } else { |
281 | | - $incoming_properties = array(); |
| 277 | + // If this is called from the command line, $wgTitle |
| 278 | + // might not have been set. |
| 279 | + if ( !is_null( $curTitle ) ) { |
| 280 | + self::getPagePropertiesOfPage( $curTitle ); |
| 281 | + $targetName = $target->getText(); |
| 282 | + if ( array_key_exists( $targetName, self::$mLinkedPages ) ) { |
| 283 | + $incoming_properties = self::$mLinkedPages[$targetName]; |
| 284 | + } |
282 | 285 | } |
283 | 286 | } else { |
284 | 287 | $incoming_properties = self::getIncomingProperties( $target ); |