r99388 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99387‎ | r99388 | r99389 >
Date:03:53, 10 October 2011
Author:yaron
Status:deferred
Tags:
Comment:
Fix for r93880 - added fix for the case where $wgTitle has not been set
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormLinker.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php
@@ -266,18 +266,21 @@
267267
268268 global $sfgRedLinksCheckOnlyLocalProps;
269269 if ( $sfgRedLinksCheckOnlyLocalProps ) {
 270+ $incoming_properties = array();
270271 if ( $linker instanceof DummyLinker ) {
271272 global $wgTitle;
272273 $curTitle = $wgTitle;
273274 } else {
274275 $curTitle = $linker->getTitle();
275276 }
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+ }
282285 }
283286 } else {
284287 $incoming_properties = self::getIncomingProperties( $target );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93880Added support for SMW 1.6 if $sfgRedLinksCheckOnlyLocalProps = trueyaron12:31, 4 August 2011