r64921 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64920‎ | r64921 | r64922 >
Date:01:05, 11 April 2010
Author:werdna
Status:deferred
Tags:
Comment:
MFT r64920
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/api (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/api/ApiFeedLQTThreads.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/classes (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/classes/Thread.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/pages (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads/pages/ThreadPermalinkView.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/api (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/api/ApiFeedLQTThreads.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/classes (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/classes/Thread.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/classes/View.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/pages (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/pages/ThreadPermalinkView.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/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();
@@ -1871,6 +1875,10 @@
18721876 array( 'id' => 'lqt-thread-sortkey-' . $thread->id() )
18731877 );
18741878 }
 1879+
 1880+ if ( ! $thread->title() ) {
 1881+ throw new MWException( "Thread ".$thread->id()." has null title" );
 1882+ }
18751883
18761884 // Add the thread's title
18771885 $html .= Xml::hidden(
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads/classes/View.php
___________________________________________________________________
Name: svn:mergeinfo
18781886 - /branches/wmf-deployment/extensions/LiquidThreads/classes/View.php:60970
/trunk/extensions/LiquidThreads/classes/View.php:57390,63727-63971,64736
18791887 + /branches/wmf-deployment/extensions/LiquidThreads/classes/View.php:60970
/trunk/extensions/LiquidThreads/classes/View.php:57390,63727-63971,64736,64920
Index: branches/wmf/1.16wmf4/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
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads/classes/Thread.php
___________________________________________________________________
Name: svn:mergeinfo
13101312 - /branches/wmf-deployment/extensions/LiquidThreads/classes/Thread.php:60970
/trunk/extensions/LiquidThreads/classes/Thread.php:57390,63727-63971,64762,64766
13111313 + /branches/wmf-deployment/extensions/LiquidThreads/classes/Thread.php:60970
/trunk/extensions/LiquidThreads/classes/Thread.php:57390,63727-63971,64762,64766,64920
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads/classes
___________________________________________________________________
Name: svn:mergeinfo
13121314 + /branches/wmf-deployment/extensions/LiquidThreads/classes:60970
/trunk/extensions/LiquidThreads/classes:57390,63727-63971,64920
Index: branches/wmf/1.16wmf4/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
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads/pages
___________________________________________________________________
Name: svn:mergeinfo
3539 + /branches/wmf-deployment/extensions/LiquidThreads/pages:60970
/trunk/extensions/LiquidThreads/pages:57390,63727-63971,64920
Index: branches/wmf/1.16wmf4/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()
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads/api
___________________________________________________________________
Name: svn:mergeinfo
186190 + /branches/wmf-deployment/extensions/LiquidThreads/api:60970
/trunk/extensions/LiquidThreads/api:57390,63727-63971,64920
Index: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/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();
@@ -1868,6 +1872,10 @@
18691873 array( 'id' => 'lqt-thread-sortkey-' . $thread->id() )
18701874 );
18711875 }
 1876+
 1877+ if ( ! $thread->title() ) {
 1878+ throw new MWException( "Thread ".$thread->id()." has null title" );
 1879+ }
18721880
18731881 // Add the thread's title
18741882 $html .= Xml::hidden(
Index: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/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
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/classes/Thread.php
___________________________________________________________________
Name: svn:mergeinfo
13101312 - /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/Thread.php:60970
/trunk/extensions/LiquidThreads/classes/Thread.php:57390,63727-63971,64762,64766
13111313 + /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/Thread.php:60970
/trunk/extensions/LiquidThreads/classes/Thread.php:57390,63727-63971,64762,64766,64920
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/classes
___________________________________________________________________
Name: svn:mergeinfo
13121314 + /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes:60970
/trunk/extensions/LiquidThreads/classes:57390,63727-63971,64920
Index: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/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
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/pages
___________________________________________________________________
Name: svn:mergeinfo
3539 + /branches/wmf-deployment/extensions/LiquidThreads_alpha/pages:60970
/trunk/extensions/LiquidThreads/pages:57390,63727-63971,64920
Index: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/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()
Property changes on: branches/wmf/1.16wmf4/extensions/LiquidThreads_alpha/api
___________________________________________________________________
Name: svn:mergeinfo
186190 + /branches/wmf-deployment/extensions/LiquidThreads_alpha/api:60970
/trunk/extensions/LiquidThreads/api:57390,63727-63971,64920

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64920LiquidThreads: Add some debugging code.werdna00:58, 11 April 2010

Status & tagging log