r84501 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84500‎ | r84501 | r84502 >
Date:23:47, 21 March 2011
Author:happy-melon
Status:ok
Tags:
Comment:
'Fix' fatal in LiquidThreads from r84475. I say 'fixed' in the loosest possible sense because I have absolutely no idea why that rev should have triggered this error. Accessing-method-of-non-object errors seem to be an ongoing bug in LQT (bug 17553), so I suspect that this was an edgecase waiting to happen, and the changes in r84475 just shifted codeflow around in such a way as to make it happen. All I've done here is make the "$article->getTitle()->equals()" comparisons safely become false if $article is null.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/Hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Hooks.php
@@ -417,10 +417,17 @@
418418 self::$editThread->getTitle()->equals( $talkPage ) );
419419 $isOnTalkPage = $isOnTalkPage || ( self::$editAppliesTo &&
420420 self::$editAppliesTo->getTitle()->equals( $talkPage ) );
421 - $isOnTalkPage = $isOnTalkPage ||
422 - ( self::$editArticle->getTitle()->equals( $talkPage ) );
423421
424 - if ( self::$editArticle->getTitle()->equals( $title ) && $isOnTalkPage ) {
 422+ # FIXME: self::$editArticle is sometimes not set; is that ok and if not why is it happening?
 423+ if( self::$editArticle instanceof Article ){
 424+ $isOnTalkPage = $isOnTalkPage ||
 425+ ( self::$editArticle->getTitle()->equals( $talkPage ) );
 426+ }
 427+
 428+ if ( self::$editArticle instanceof Article
 429+ && self::$editArticle->getTitle()->equals( $title )
 430+ && $isOnTalkPage )
 431+ {
425432 $isBlocked = false;
426433 return true;
427434 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84475Blame hashar for this giant commit; he teased me for making so many smaller o...happy-melon19:12, 21 March 2011

Status & tagging log