From e92ce78b5cbc842850e4e8d46e117045d3fa8b5a Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 16 Jul 2009 15:20:13 +0000 Subject: [PATCH] LiquidThreads updates: * Overhaul deletion system. Totally remove deletion special page, deletion will now be handled through the standard MediaWiki deletion system. When a thread's "root" is deleted, the thread itself is marked as deleted. When the page is re-undeleted, the thread will be marked as restored. * Move some class files from Lqt* to simply *. * Remove HistoryIterator class, pointless. * Miscellaneous code quality as found. Includes core changes to pass comment along with ArticleRevisionUndeleted hook. --- docs/hooks.txt | 1 + includes/specials/SpecialUndelete.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index d3a70a61e6..c2e73f5c4d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -463,6 +463,7 @@ $baseRevId: the rev ID (or false) this edit was based on $title: Title corresponding to the article restored $create: Whether or not the restoration caused the page to be created (i.e. it didn't exist before) +$comment: The comment associated with the undeletion. 'ArticleUpdateBeforeRedirect': After a page is updated (usually on save), before the user is redirected back to the page diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index d8c9d1310b..f713fe437d 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -332,7 +332,7 @@ class PageArchive { } if( $restoreText ) { - $textRestored = $this->undeleteRevisions( $timestamps, $unsuppress ); + $textRestored = $this->undeleteRevisions( $timestamps, $unsuppress, $comment ); if($textRestored === false) // It must be one of UNDELETE_* return false; } else { @@ -377,7 +377,7 @@ class PageArchive { * * @return mixed number of revisions restored or false on failure */ - private function undeleteRevisions( $timestamps, $unsuppress = false ) { + private function undeleteRevisions( $timestamps, $unsuppress = false, $comment = '' ) { if ( wfReadOnly() ) return false; $restoreAll = empty( $timestamps ); @@ -510,10 +510,10 @@ class PageArchive { } if( $newid ) { - wfRunHooks( 'ArticleUndelete', array( &$this->title, true ) ); + wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) ); Article::onArticleCreate( $this->title ); } else { - wfRunHooks( 'ArticleUndelete', array( &$this->title, false ) ); + wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) ); Article::onArticleEdit( $this->title ); } -- 2.20.1