use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\RevisionRenderer;
use MediaWiki\Revision\RevisionStore;
+use MediaWiki\Revision\SlotRoleRegistry;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Storage\DerivedPageDataUpdater;
use MediaWiki\Storage\PageUpdater;
return MediaWikiServices::getInstance()->getRevisionRenderer();
}
+ /**
+ * @return SlotRoleRegistry
+ */
+ private function getSlotRoleRegistry() {
+ return MediaWikiServices::getInstance()->getSlotRoleRegistry();
+ }
+
/**
* @return ParserCache
*/
// links.
$hasLinks = (bool)count( $editInfo->output->getLinks() );
} else {
- // NOTE: keep in sync with revisionRenderer::getLinkCount
+ // NOTE: keep in sync with RevisionRenderer::getLinkCount
+ // NOTE: keep in sync with DerivedPageDataUpdater::isCountable
$hasLinks = (bool)wfGetDB( DB_REPLICA )->selectField( 'pagelinks', 1,
[ 'pl_from' => $this->getId() ], __METHOD__ );
}
}
+ // TODO: MCR: determine $hasLinks for each slot, and use that info
+ // with that slot's Content's isCountable method. That requires per-
+ // slot ParserOutput in the ParserCache, or per-slot info in the
+ // pagelinks table.
return $content->isCountable( $hasLinks );
}
$this, // NOTE: eventually, PageUpdater should not know about WikiPage
$this->getRevisionStore(),
$this->getRevisionRenderer(),
+ $this->getSlotRoleRegistry(),
$this->getParserCache(),
JobQueueGroup::singleton(),
MessageCache::singleton(),
$this, // NOTE: eventually, PageUpdater should not know about WikiPage
$this->getDerivedDataUpdater( $user, null, $forUpdate, true ),
$this->getDBLoadBalancer(),
- $this->getRevisionStore()
+ $this->getRevisionStore(),
+ $this->getSlotRoleRegistry()
);
$pageUpdater->setUsePageCreationLog( $wgPageCreationLog );
// in the job queue to avoid simultaneous deletion operations would add overhead.
// Number of archived revisions cannot be known beforehand, because edits can be made
// while deletion operations are being processed, changing the number of archivals.
- $archivedRevisionCount = $dbw->selectField(
+ $archivedRevisionCount = (int)$dbw->selectField(
'archive', 'COUNT(*)',
[
'ar_namespace' => $this->getTitle()->getNamespace(),