Merge "output: Narrow Title type hint to LinkTarget"
[lhc/web/wiklou.git] / includes / deferred / LinksUpdate.php
index 74e236f..c4e8341 100644 (file)
@@ -125,7 +125,7 @@ class LinksUpdate extends DataUpdate {
 
                if ( !$this->mId ) {
                        // NOTE: subclasses may initialize mId before calling this constructor!
-                       $this->mId = $title->getArticleID( Title::GAID_FOR_UPDATE );
+                       $this->mId = $title->getArticleID( Title::READ_LATEST );
                }
 
                if ( !$this->mId ) {
@@ -1066,6 +1066,7 @@ class LinksUpdate extends DataUpdate {
        private function invalidateProperties( $changed ) {
                global $wgPagePropLinkInvalidations;
 
+               $jobs = [];
                foreach ( $changed as $name => $value ) {
                        if ( isset( $wgPagePropLinkInvalidations[$name] ) ) {
                                $inv = $wgPagePropLinkInvalidations[$name];
@@ -1073,12 +1074,16 @@ class LinksUpdate extends DataUpdate {
                                        $inv = [ $inv ];
                                }
                                foreach ( $inv as $table ) {
-                                       DeferredUpdates::addUpdate(
-                                               new HTMLCacheUpdate( $this->mTitle, $table, 'page-props' )
+                                       $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
+                                               $this->mTitle,
+                                               $table,
+                                               [ 'causeAction' => 'page-props' ]
                                        );
                                }
                        }
                }
+
+               JobQueueGroup::singleton()->lazyPush( $jobs );
        }
 
        /**