return ( $this->mcrMigrationStage & $flags ) === $flags;
}
+ /**
+ * Throws a RevisionAccessException if this RevisionStore is configured for cross-wiki loading
+ * and still reading from the old DB schema.
+ *
+ * @throws RevisionAccessException
+ */
+ private function assertCrossWikiContentLoadingIsSafe() {
+ if ( $this->wikiId !== false && $this->hasMcrSchemaFlags( SCHEMA_COMPAT_READ_OLD ) ) {
+ throw new RevisionAccessException(
+ "Cross-wiki content loading is not supported by the pre-MCR schema"
+ );
+ }
+ }
+
public function setLogger( LoggerInterface $logger ) {
$this->logger = $logger;
}
// MCR migration note: rev_content_model and rev_content_format will go away
if ( $this->contentHandlerUseDB ) {
+ $this->assertCrossWikiContentLoadingIsSafe();
+
$defaultModel = ContentHandler::getDefaultModelFor( $title );
$defaultFormat = ContentHandler::getForModelID( $defaultModel )->getDefaultFormat();
// if $wgContentHandlerUseDB is not set,
// all revisions must use the default content model and format.
+ $this->assertCrossWikiContentLoadingIsSafe();
+
$defaultModel = ContentHandler::getDefaultModelFor( $title );
$defaultHandler = ContentHandler::getForModelID( $defaultModel );
$defaultFormat = $defaultHandler->getDefaultFormat();
if ( $mainSlotRow->model_name === null ) {
$mainSlotRow->model_name = function ( SlotRecord $slot ) use ( $title ) {
+ $this->assertCrossWikiContentLoadingIsSafe();
+
// TODO: MCR: consider slot role in getDefaultModelFor()! Use LinkTarget!
// TODO: MCR: deprecate $title->getModel().
return ContentHandler::getDefaultModelFor( $title );
* @param ActorMigration $actorMigration
* @param int $migrationStage
* @param LoggerSpi $loggerProvider
- * @param bool $contentHandlerUseDB see {@link $wgContentHandlerUseDB}
+ * @param bool $contentHandlerUseDB see {@link $wgContentHandlerUseDB}. Must be the same
+ * for all wikis in the cluster. Will go away after MCR migration.
*/
public function __construct(
ILBFactory $dbLoadBalancerFactory,
!empty( $extraInputsDescriptor )
) {
$formDescriptor[ 'extra' ] = $extraInputsDescriptor;
- } elseif ( is_string( $extraInputsDescriptor ) ) {
+ } elseif (
+ is_string( $extraInputsDescriptor ) &&
+ $extraInputsDescriptor !== ''
+ ) {
// We'll add this to the footer of the form later
$extraInputsString = $extraInputsDescriptor;
- wfDeprecated( 'Using $input in LogEventsListGetExtraInputs hook', '1.32' );
+ wfDeprecated( '$input in LogEventsListGetExtraInputs hook', '1.32' );
}
// Title pattern, if allowed
*/
/**
- * @uses XhprofData
- * @uses AutoLoader
* @copyright © 2014 Wikimedia Foundation and contributors
* @since 1.25
*/
/**
* @covers XhprofData::getCallers
* @covers XhprofData::getCallees
- * @uses XhprofData
*/
public function testEdges() {
$xhprofData = $this->getXhprofDataFixture();
/**
* @covers XhprofData::getCriticalPath
- * @uses XhprofData
*/
public function testCriticalPath() {
$xhprofData = $this->getXhprofDataFixture();