Give extensions a chance to hide their (unrelated) log entries
authorMatthias Mullie <git@mullie.eu>
Tue, 29 Oct 2013 11:15:18 +0000 (12:15 +0100)
committerMatthias Mullie <git@mullie.eu>
Fri, 15 Nov 2013 16:59:53 +0000 (17:59 +0100)
Change-Id: Id8b0f29d6e2ac9d7cab8f3d1efcb202062a6ad0b

HISTORY
docs/hooks.txt
includes/Article.php

diff --git a/HISTORY b/HISTORY
index 88cc906..0e7de0c 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -122,6 +122,8 @@ production.
   correctly.
 * (bug 45803) Whitespace within == Headline == syntax and within <hN> headings
   is now non-significant and not preserved in the HTML output.
+* Added Article::MissingArticleConditions hook to give extensions a chance to
+  hide their (unrelated) log entries.
 
 === Bug fixes in 1.21 ===
 * (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
index 1cd112b..d56886c 100644 (file)
@@ -461,6 +461,13 @@ types.
 &$tokenTypes: supported token types in format 'type' => callback function
 used to retrieve this type of tokens.
 
+'Article::MissingArticleConditions': Before fetching deletion & move log entries
+to display a message of a non-existing page being deleted/moved, give extensions
+a chance to hide their (unrelated) log entries.
+&$conds: Array of query conditions (all of which have to be met; conditions will
+AND in the final query)
+$logTypes: Array of log types being queried
+
 'ArticleAfterFetchContent': After fetching content of an article from the
 database. DEPRECATED, use ArticleAfterFetchContentObject instead.
 $article: the article (object) being loaded from the database
index 1619e09..854f7f1 100644 (file)
@@ -1201,10 +1201,15 @@ class Article implements Page {
 
                wfRunHooks( 'ShowMissingArticle', array( $this ) );
 
+               // Give extensions a chance to hide their (unrelated) log entries
+               $logTypes = array( 'delete', 'move' );
+               $conds = array( "log_action != 'revision'" );
+               wfRunHooks( 'Article::MissingArticleConditions', array( &$conds, $logTypes ) );
+
                # Show delete and move logs
-               LogEventsList::showLogExtract( $outputPage, array( 'delete', 'move' ), $this->getTitle(), '',
+               LogEventsList::showLogExtract( $outputPage, $logTypes, $this->getTitle(), '',
                        array( 'lim' => 10,
-                               'conds' => array( "log_action != 'revision'" ),
+                               'conds' => $conds,
                                'showIfEmpty' => false,
                                'msgKey' => array( 'moveddeleted-notice' ) )
                );