r64920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64919‎ | r64920 | r64921 >
Date:00:58, 11 April 2010
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads: Add some debugging code.
Modified paths:
  • /trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/Thread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/ThreadPermalinkView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -110,6 +110,10 @@
111111
112112 static function linkInContextData( $thread, $contextType = 'page' ) {
113113 $query = array();
 114+
 115+ if ( ! $thread ) {
 116+ throw new MWException( "Null thread passed to linkInContextData" );
 117+ }
114118
115119 if ( $contextType == 'page' ) {
116120 $title = clone $thread->article()->getTitle();
@@ -1901,6 +1905,10 @@
19021906 array( 'id' => 'lqt-thread-sortkey-' . $thread->id() )
19031907 );
19041908 }
 1909+
 1910+ if ( ! $thread->title() ) {
 1911+ throw new MWException( "Thread ".$thread->id()." has null title" );
 1912+ }
19051913
19061914 // Add the thread's title
19071915 $html .= Xml::hidden(
Index: trunk/extensions/LiquidThreads/classes/Thread.php
@@ -1302,7 +1302,9 @@
13031303 }
13041304
13051305 function rootRevision() {
1306 - if ( !$this->isHistorical() || !isset( $this->topmostThread()->threadRevision ) ) {
 1306+ if ( !$this->isHistorical() ||
 1307+ !isset( $this->topmostThread()->threadRevision ) ||
 1308+ ! $this->root() ) {
13071309 return null;
13081310 }
13091311
Index: trunk/extensions/LiquidThreads/pages/ThreadPermalinkView.php
@@ -28,6 +28,10 @@
2929 unset( $content_actions['viewsource'] );
3030 unset( $content_actions['talk'] );
3131
 32+ if ( ! $view->thread->title() ) {
 33+ throw new MWException( "Thread ".$view->thread->id()." has null title" );
 34+ }
 35+
3236 $subpage = $view->thread->title()->getPrefixedText();
3337
3438 // Repoint move/delete/history tabs
Index: trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php
@@ -179,6 +179,10 @@
180180 $root = new Article( Title::newFromText( $thread ) );
181181 $thread = Threads::withRoot( $root );
182182
 183+ if ( ! $thread ) {
 184+ continue;
 185+ }
 186+
183187 $threadCond = array(
184188 'thread_ancestor' => $thread->id(),
185189 'thread_id' => $thread->id()

Follow-up revisions

RevisionCommit summaryAuthorDate
r64921MFT r64920werdna01:05, 11 April 2010

Status & tagging log