Merge "CategorySelector: Add different ways of searching"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / RefreshLinksJob.php
index c66da41..935d2fb 100644 (file)
@@ -83,7 +83,6 @@ class RefreshLinksJob extends Job {
                        } else {
                                $extraParams['masterPos'] = false;
                        }
-                       $extraParams['triggeredRecursive'] = true;
                        // Convert this into no more than $wgUpdateRowsPerJob RefreshLinks per-title
                        // jobs and possibly a recursive RefreshLinks job for the rest of the backlinks
                        $jobs = BacklinkJobUtils::partitionBacklinkJob(
@@ -112,9 +111,6 @@ class RefreshLinksJob extends Job {
         * @return bool
         */
        protected function runForTitle( Title $title = null ) {
-               $linkCache = LinkCache::singleton();
-               $linkCache->clear();
-
                if ( is_null( $title ) ) {
                        $this->setLastError( "refreshLinks: Invalid title" );
                        return false;
@@ -127,14 +123,18 @@ class RefreshLinksJob extends Job {
                        wfGetLB()->waitFor( $this->params['masterPos'] );
                }
 
-               $page = WikiPage::factory( $title );
+               // Clear out title cache data from prior job transaction snapshots
+               $linkCache = LinkCache::singleton();
+               $linkCache->clear();
 
-               // Fetch the current revision...
+               // Fetch the current page and revision...
+               $page = WikiPage::factory( $title );
                $revision = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
                if ( !$revision ) {
                        $this->setLastError( "refreshLinks: Article not found {$title->getPrefixedDBkey()}" );
                        return false; // XXX: what if it was just deleted?
                }
+
                $content = $revision->getContent( Revision::RAW );
                if ( !$content ) {
                        // If there is no content, pretend the content is empty
@@ -197,12 +197,6 @@ class RefreshLinksJob extends Job {
                }
 
                $updates = $content->getSecondaryDataUpdates( $title, null, false, $parserOutput );
-               foreach ( $updates as $key => $update ) {
-                       if ( $update instanceof LinksUpdate && isset( $this->params['triggeredRecursive'] ) ) {
-                               $update->setTriggeredRecursive();
-                       }
-               }
-
                DataUpdate::runUpdates( $updates );
 
                InfoAction::invalidateCache( $title );