r53392 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53391‎ | r53392 | r53393 >
Date:10:10, 17 July 2009
Author:ialex
Status:deferred
Tags:
Comment:
fix hooks so that they work correctly on namesapce != NS_LQT_THREAD
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/DeletionController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/DeletionController.php
@@ -7,7 +7,7 @@
88 $title = $article->getTitle();
99
1010 if ($title->getNamespace() != NS_LQT_THREAD) {
11 - return;
 11+ return true;
1212 }
1313
1414 $threads = Threads::where( array( 'thread_root' => $id ) );
@@ -34,7 +34,7 @@
3535 static function onArticleDelete( &$article, &$user, &$reason, &$error ) {
3636 $thread = Threads::withRoot( $article );
3737
38 - if ($thread->isTopmostThread() && count($thread->replies())) {
 38+ if ( is_object( $thread ) && $thread->isTopmostThread() && count($thread->replies())) {
3939 $error = wfMsgExt( 'lqt-delete-has-subthreads', 'parse' );
4040 return false;
4141 }

Status & tagging log