From: Aaron Schulz Date: Wed, 13 Mar 2019 18:31:58 +0000 (-0700) Subject: Avoid page table query spam in HistoryPager due to lastLink() X-Git-Tag: 1.34.0-rc.0~2538^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=dabbf42aa702ef1095bd3ecff03447360f4e0aea;p=lhc%2Fweb%2Fwiklou.git Avoid page table query spam in HistoryPager due to lastLink() Pass in the Title so there is not an extra query for each revision. Change-Id: I0d36422a304c31c4bda0a408ef4a6fcd52ad57f1 --- diff --git a/includes/Title.php b/includes/Title.php index 82e79b379c..9161733aeb 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -437,6 +437,7 @@ class Title implements LinkTarget, IDBAccessObject { } else { $title = null; } + return $title; } diff --git a/includes/actions/pagers/HistoryPager.php b/includes/actions/pagers/HistoryPager.php index a59597fea9..d3a32d0e27 100644 --- a/includes/actions/pagers/HistoryPager.php +++ b/includes/actions/pagers/HistoryPager.php @@ -541,7 +541,7 @@ class HistoryPager extends ReverseChronologicalPager { ); } - $nextRev = new Revision( $next ); + $nextRev = new Revision( $next, 0, $this->getTitle() ); if ( !$prevRev->userCan( Revision::DELETED_TEXT, $this->getUser() ) || !$nextRev->userCan( Revision::DELETED_TEXT, $this->getUser() )