r97140 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97139‎ | r97140 | r97141 >
Date:11:03, 15 September 2011
Author:catrope
Status:old
Tags:
Comment:
1.17wmf1: Commit live hack for two LiquidThreads fatals
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/LiquidThreads/classes/Hooks.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/LiquidThreads/classes/Hooks.php
@@ -177,8 +177,13 @@
178178 $attribs = array();
179179 $attribs['ThreadSubject'] = $thread->subject();
180180 if ( $thread->hasSuperThread() ) {
181 - $attribs['ThreadParent'] = $thread->superThread()->title()->getPrefixedText();
182 - $attribs['ThreadAncestor'] = $thread->topmostThread()->title()->getPrefixedText();
 181+ # HACK: This was throwing fatals during XML dumps on the cluster
 182+ if ( $thread->superThread() && $thread->superThread()->title() ) {
 183+ $attribs['ThreadParent'] = $thread->superThread()->title()->getPrefixedText();
 184+ }
 185+ if ( $thread->topmostThread() && $thread->topmostThread()->title() ) {
 186+ $attribs['ThreadAncestor'] = $thread->topmostThread()->title()->getPrefixedText();
 187+ }
183188 }
184189 $attribs['ThreadPage'] = $thread->getTitle()->getPrefixedText();
185190 $attribs['ThreadID'] = $thread->id();
@@ -226,6 +231,11 @@
227232 }
228233
229234 $thread = Threads::withRoot( new Article( $title ) );
 235+ # HACK: The following lines were throwing fatals on the cluster
 236+ if ( !$thread ) {
 237+ return true;
 238+ }
 239+
230240 $text = $thread->subject();
231241
232242 $title = clone $thread->topmostThread()->title();

Status & tagging log