From dc4cc3210058c9be73748a5efe2370d401922dea Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 10 Jul 2016 04:14:12 -0700 Subject: [PATCH] Use READ_LATEST for the WikiPage in RefreshLinksJob Also sanity check that the revision belongs to that page. Change-Id: I4e6897b52212d9787d74fb017861ec62f2927f0e --- includes/jobqueue/jobs/RefreshLinksJob.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 88705695cb..c76ea4f9ab 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -129,6 +129,7 @@ class RefreshLinksJob extends Job { */ protected function runForTitle( Title $title ) { $page = WikiPage::factory( $title ); + $page->loadPageData( WikiPage::READ_LATEST ); if ( !empty( $this->params['triggeringRevisionId'] ) ) { // Fetch the specified revision; lockAndGetLatest() below detects if the page // was edited since and aborts in order to avoid corrupting the link tables @@ -147,7 +148,7 @@ class RefreshLinksJob extends Job { $stats->increment( 'refreshlinks.rev_not_found' ); $this->setLastError( "Revision not found for {$title->getPrefixedDBkey()}" ); return false; // just deleted? - } elseif ( !$revision->isCurrent() ) { + } elseif ( !$revision->isCurrent() || $revision->getPage() != $page->getId() ) { // If the revision isn't current, there's no point in doing a bunch // of work just to fail at the lockAndGetLatest() check later. $stats->increment( 'refreshlinks.rev_not_current' ); -- 2.20.1