X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FLinksUpdate.php;h=9d3309bad588917e681d52da209639b17a48c64f;hb=6497541c9c089966ce7d3b0e0abd6b68192d30d8;hp=7a31e262539454047a541102f5413396c393b00d;hpb=43a0144346da4e6edbbadee0b7d9def53357bc10;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 7a31e26253..9d3309bad5 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -122,7 +122,11 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { parent::__construct(); $this->mTitle = $title; - $this->mId = $title->getArticleID( Title::GAID_FOR_UPDATE ); + + if ( !$this->mId ) { + // NOTE: subclasses may initialize mId before calling this constructor! + $this->mId = $title->getArticleID( Title::GAID_FOR_UPDATE ); + } if ( !$this->mId ) { throw new InvalidArgumentException( @@ -611,7 +615,8 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { $nt = Title::makeTitleSafe( NS_CATEGORY, $name ); $contLang->findVariantLink( $name, $nt, true ); - $type = MWNamespace::getCategoryLinkType( $this->mTitle->getNamespace() ); + $type = MediaWikiServices::getInstance()->getNamespaceInfo()-> + getCategoryLinkType( $this->mTitle->getNamespace() ); # Treat custom sortkeys as a prefix, so that if multiple # things are forced to sort as '*' or something, they'll @@ -1180,7 +1185,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { /** * @return IDatabase */ - private function getDB() { + protected function getDB() { if ( !$this->db ) { $this->db = wfGetDB( DB_MASTER ); } @@ -1205,7 +1210,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { } return [ - 'wiki' => WikiMap::getWikiIdFromDbDomain( $this->getDB()->getDomainID() ), + 'domain' => $this->getDB()->getDomainID(), 'job' => new JobSpecification( 'refreshLinksPrioritized', [