Introduce PageHistoryPager::doBatchLookups hook.
The intention of the new hook is to allow extensions to prefetch any information that may be needed for displaying history rows. In particular, this is needed by Wikibase to allow us to inject localized entity labels into the edit summaries. Bug: T95672 Change-Id: Ie10ef99154da35713a4f583e2de2162fba28eef2
This commit is contained in:
parent
a6aa1d2d25
commit
a7f26eb3b7
3 changed files with 12 additions and 0 deletions
|
|
@ -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 ==
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue