r52551 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52550‎ | r52551 | r52552 >
Date:16:33, 29 June 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix bizarre handling of $thread->article() calls, wasn't considering the possibility of new threads properly.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/LqtThread.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/LqtThread.php
@@ -557,14 +557,18 @@
558558 function article() {
559559 if ( $this->article ) return $this->article;
560560
561 - $title = Title::newFromID( $this->articleId );
562 - if ( $title ) {
563 - $a = new Article( $title );
 561+ if ( !is_null( $this->articleId ) ) {
 562+ $title = Title::newFromID( $this->articleId );
 563+ if ( $title ) {
 564+ $article = new Article( $title );
 565+ }
564566 }
565 - if ( isset( $a ) && $a->exists() ) {
566 - return $a;
 567+ if ( isset( $article ) && $article->exists() ) {
 568+ $this->article = $article;
 569+ return $article;
567570 } else {
568 - return new Article( Title::makeTitle( $this->articleNamespace, $this->articleTitle ) );
 571+ $title = Title::makeTitle( $this->articleNamespace, $this->articleTitle );
 572+ return new Article( $title );
569573 }
570574 }
571575

Status & tagging log