http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72489
Revision: 72489
Author: werdna
Date: 2010-09-06 12:59:42 +0000 (Mon, 06 Sep 2010)
Log Message:
-----------
Fix issue in r71869 where it would try to mark historical threads as deleted.
Modified Paths:
--------------
trunk/extensions/LiquidThreads/classes/Dispatch.php
trunk/extensions/LiquidThreads/classes/Thread.php
trunk/extensions/LiquidThreads/classes/View.php
Modified: trunk/extensions/LiquidThreads/classes/Dispatch.php
===================================================================
--- trunk/extensions/LiquidThreads/classes/Dispatch.php 2010-09-06 12:28:24 UTC
(rev 72488)
+++ trunk/extensions/LiquidThreads/classes/Dispatch.php 2010-09-06 12:59:42 UTC
(rev 72489)
@@ -21,13 +21,11 @@
return false;
}
- /**
- * Certain actions apply to the "header", which is stored in
the actual talkpage
- * in the database. Drop everything and behave like a normal
page if those
- * actions come up, to avoid hacking the various history,
editing, etc. code.
- */
- $action = $request->getVal( 'action' );
- $header_actions = array( 'history', 'edit', 'submit', 'delete'
);
+ global $mediaWiki;
+ $action = $mediaWiki->getVal('action');
+
+ // Actions handled by LQT.
+ $lqt_actions = array( 'view', 'protect', 'unprotect' );
$lqt_action = $request->getVal( 'lqt_method' );
if ( $action == 'edit' && $request->getVal( 'section' ) ==
'new' ) {
@@ -36,7 +34,8 @@
$request->setVal( 'section', '' );
$viewname = 'TalkpageView';
- } elseif ( !$lqt_action && ( in_array( $action, $header_actions
) ||
+ } elseif ( !$lqt_action && (
+ ( !in_array( $action, $lqt_actions ) &&
$action) ||
$request->getVal( 'diff', null ) !== null ) ) {
// Pass through wrapper
$viewname = 'TalkpageHeaderView';
Modified: trunk/extensions/LiquidThreads/classes/Thread.php
===================================================================
--- trunk/extensions/LiquidThreads/classes/Thread.php 2010-09-06 12:28:24 UTC
(rev 72488)
+++ trunk/extensions/LiquidThreads/classes/Thread.php 2010-09-06 12:59:42 UTC
(rev 72489)
@@ -324,9 +324,9 @@
}
function delete( $reason, $commit = true ) {
-
+ $this->type = Threads::TYPE_DELETED;
+
if ( $commit ) {
- $this->type = Threads::TYPE_DELETED;
$this->commitRevision( Threads::CHANGE_DELETED, $this,
$reason );
}
/* Mark thread as read by all users, or we get blank thingies
in New Messages. */
@@ -1158,7 +1158,11 @@
}
if ( !$title && $this->type() != Threads::TYPE_DELETED
) {
- $this->delete('', false /* !commit */);
+ if ( ! $this->isHistorical() ) {
+ $this->delete('', false /* !commit */);
+ } else {
+ $this->type = Threads::TYPE_DELETED;
+ }
}
if ( !$title ) {
Modified: trunk/extensions/LiquidThreads/classes/View.php
===================================================================
--- trunk/extensions/LiquidThreads/classes/View.php 2010-09-06 12:28:24 UTC
(rev 72488)
+++ trunk/extensions/LiquidThreads/classes/View.php 2010-09-06 12:59:42 UTC
(rev 72489)
@@ -1279,7 +1279,6 @@
// Remove title, so that it stays set correctly.
$parserOutput->setTitleText( '' );
-
$wgOut->addParserOutputNoText( $parserOutput );
return $parserOutput->getText();
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs