Merge "Fix deprecated hooks not having a non-deprecated alternative"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 30 Jul 2014 13:53:36 +0000 (13:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 30 Jul 2014 13:53:36 +0000 (13:53 +0000)
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialWatchlist.php

index 3c8bdcc..806a48a 100644 (file)
@@ -291,8 +291,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        ''
                );
 
-               if ( !wfRunHooks( 'ChangesListSpecialPageQuery',
-                       array( $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) )
+               if ( !$this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds,
+                       $opts )
                ) {
                        return false;
                }
@@ -309,6 +309,13 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                );
        }
 
+       protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+               return wfRunHooks(
+                       'ChangesListSpecialPageQuery',
+                       array( $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts )
+               );
+       }
+
        /**
         * Return a DatabaseBase object for reading
         *
index a2e271e..ea785fa 100644 (file)
@@ -229,9 +229,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        $opts['tagfilter']
                );
 
-               if ( !wfRunHooks( 'SpecialRecentChangesQuery',
-                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ),
-                       '1.23' )
+               if ( !$this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds,
+                       $opts )
                ) {
                        return false;
                }
@@ -255,6 +254,15 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                return $rows;
        }
 
+       protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+               return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
+                       && wfRunHooks(
+                               'SpecialRecentChangesQuery',
+                               array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ),
+                               '1.23'
+                       );
+       }
+
        public function outputFeedLinks() {
                $this->addFeedLinks( $this->getFeedQuery() );
        }
index e73cabc..6c617cd 100644 (file)
@@ -109,9 +109,8 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                        $opts['tagfilter']
                );
 
-               if ( !wfRunHooks( 'SpecialRecentChangesQuery',
-                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ),
-                       '1.23' )
+               if ( !$this->runMainQueryHook( $conds, $tables, $join_conds, $opts, $query_options,
+                       $select )
                ) {
                        return false;
                }
@@ -221,6 +220,15 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                return $res;
        }
 
+       protected function runMainQueryHook( &$tables, &$select, &$conds, &$query_options, &$join_conds, $opts ) {
+               return parent::runMainQueryHook( $tables, $select, $conds, $query_options, $join_conds, $opts )
+               && wfRunHooks(
+                       'SpecialRecentChangesQuery',
+                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ),
+                       '1.23'
+               );
+       }
+
        function setTopText( FormOptions $opts ) {
                $target = $this->getTargetTitle();
                if ( $target ) {
index b2574e0..5691e50 100644 (file)
@@ -279,9 +279,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                        ''
                );
 
-               wfRunHooks( 'SpecialWatchlistQuery',
-                       array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
-                       '1.23' );
+               $this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts );
 
                return $dbr->select(
                        $tables,
@@ -293,6 +291,15 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                );
        }
 
+       protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+               return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
+                       && wfRunHooks(
+                               'SpecialWatchlistQuery',
+                               array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
+                               '1.23'
+                       );
+       }
+
        /**
         * Return a DatabaseBase object for reading
         *