r59195 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59194‎ | r59195 | r59196 >
Date:13:28, 18 November 2009
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads: fix some fatals in cases where threads have been deleted
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/ThreadHistoryPager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/ThreadHistoryPager.php
@@ -103,7 +103,11 @@
104104 $args = array();
105105 $revision = ThreadRevision::loadFromRow( $this->mCurrentRow );
106106
107 - $args[] = $revision->getChangeObject()->title()->getPrefixedText();
 107+ if ( $revision->getChangeObject()->title() ) {
 108+ $args[] = $revision->getChangeObject()->title()->getPrefixedText();
 109+ } else {
 110+ $args[] = '';
 111+ }
108112
109113 switch( $type ) {
110114 case Threads::CHANGE_EDITED_SUBJECT:
@@ -114,8 +118,13 @@
115119 case Threads::CHANGE_ROOT_BLANKED:
116120 $post = $revision->getChangeObject();
117121 $view = $this->view;
118 - $diffLink = $view->diffPermalinkURL( $post, $revision );
119 - $args[] = $diffLink;
 122+
 123+ if ( $post->title() ) {
 124+ $diffLink = $view->diffPermalinkURL( $post, $revision );
 125+ $args[] = $diffLink;
 126+ } else {
 127+ $args[] = '';
 128+ }
120129 break;
121130 }
122131

Status & tagging log