RefreshLinksJob parsed with incorrect revision variables
authorumherirrender <umherirrender_de.wp@web.de>
Tue, 27 Nov 2012 20:49:58 +0000 (21:49 +0100)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 27 Nov 2012 21:41:19 +0000 (13:41 -0800)
It is necessary to pass the revision id to the parser output to get the
revision variables like REVISIONTIMESTAMP correct. Doing this self
in the job prevents from calling Title::getLatestRevId in
Content::getSecondaryDataUpdates or other places.

This behaviour was lost in I551a90b0

Change-Id: I4bf0e8199edacaa703699f45ec8e65ca9e31e765

includes/job/jobs/RefreshLinksJob.php

index 384244f..86c808b 100644 (file)
@@ -78,7 +78,10 @@ class RefreshLinksJob extends Job {
                        $content = $revision->getContentHandler()->makeEmptyContent();
                }
 
-               $updates = $content->getSecondaryDataUpdates( $title, null, false );
+               // Revision ID must be passed to the parser output to get revision variables correct
+               $parserOutput = $content->getParserOutput( $title, $revision->getId(), null, false );
+
+               $updates = $content->getSecondaryDataUpdates( $title, null, false, $parserOutput );
                DataUpdate::runUpdates( $updates );
                wfProfileOut( $fname );
        }