Merge "Introduce PageHistoryPager::doBatchLookups hook."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 16 Apr 2015 22:45:05 +0000 (22:45 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 16 Apr 2015 22:45:05 +0000 (22:45 +0000)
RELEASE-NOTES-1.26
docs/hooks.txt
includes/actions/HistoryAction.php

index 89dad11..bf9341d 100644 (file)
@@ -34,6 +34,7 @@ changes to languages because of Bugzilla reports.
 === Other changes in 1.26 ===
 * ChangeTags::tagDescription() will return false if the interface message
   for the tag is disabled.
+* Added PageHistoryPager::doBatchLookups hook.
 
 == Compatibility ==
 
index 877b7ed..6f59b2d 100644 (file)
@@ -2112,6 +2112,13 @@ constructed.
 $pager: the pager
 $queryInfo: the query parameters
 
+'PageHistoryPager::doBatchLookups': Called after the pager query was run, before
+any output is generated, to allow batch lookups for prefetching information
+needed for display. If the hook handler returns false, the regular behavior of
+doBatchLookups() is skipped.
+$pager: the PageHistoryPager
+$result: a ResultWrapper representing the query result
+
 'PageRenderingHash': Alter the parser cache option hash key. A parser extension
 which depends on user options should install this hook and append its values to
 the key.
index 6693178..83185e4 100644 (file)
@@ -448,6 +448,10 @@ class HistoryPager extends ReverseChronologicalPager {
        }
 
        function doBatchLookups() {
+               if ( !Hooks::run( 'PageHistoryPager::doBatchLookups', array( $this, $this->mResult ) ) ) {
+                       return;
+               }
+
                # Do a link batch query
                $this->mResult->seek( 0 );
                $batch = new LinkBatch();