X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateContentTables.php;h=567161f6f180b21cd9a32554a3d263185db81863;hb=f0dae32ae236c7abb4ef852b2cc312740aa8b239;hp=c84f3de54ecb80aef11ef1e50db316bbbe1db83e;hpb=fa2561e9e7c26f4e0f7212fdb1d643a40ee1b920;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateContentTables.php b/maintenance/populateContentTables.php index c84f3de54e..567161f6f1 100644 --- a/maintenance/populateContentTables.php +++ b/maintenance/populateContentTables.php @@ -42,6 +42,9 @@ class PopulateContentTables extends Maintenance { /** @var NameTableStore */ private $contentModelStore; + /** @var NameTableStore */ + private $slotRoleStore; + /** @var BlobStore */ private $blobStore; @@ -71,17 +74,23 @@ class PopulateContentTables extends Maintenance { private function initServices() { $this->dbw = $this->getDB( DB_MASTER ); $this->contentModelStore = MediaWikiServices::getInstance()->getContentModelStore(); + $this->slotRoleStore = MediaWikiServices::getInstance()->getSlotRoleStore(); $this->blobStore = MediaWikiServices::getInstance()->getBlobStore(); - $this->mainRoleId = MediaWikiServices::getInstance()->getSlotRoleStore() - ->acquireId( SlotRecord::MAIN ); + + // Don't trust the cache for the NameTableStores, in case something went + // wrong during a previous run (see T224949#5325895). + $this->contentModelStore->reloadMap(); + $this->slotRoleStore->reloadMap(); + $this->mainRoleId = $this->slotRoleStore->acquireId( SlotRecord::MAIN ); } public function execute() { - global $wgMultiContentRevisionSchemaMigrationStage; + $multiContentRevisionSchemaMigrationStage = + $this->getConfig()->get( 'MultiContentRevisionSchemaMigrationStage' ); $t0 = microtime( true ); - if ( ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) === 0 ) { + if ( ( $multiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) === 0 ) { $this->writeln( '...cannot update while \$wgMultiContentRevisionSchemaMigrationStage ' . 'does not have the SCHEMA_COMPAT_WRITE_NEW bit set.'