'Reading needs to be enabled for the old or the new schema.'
);
Assert::parameter(
- ( $mcrMigrationStage & SCHEMA_COMPAT_WRITE_BOTH ) !== 0,
+ ( $mcrMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) !== 0,
'$mcrMigrationStage',
- 'Writing needs to be enabled for the old or the new schema.'
+ 'Writing needs to be enabled for the new schema.'
);
Assert::parameter(
( $mcrMigrationStage & SCHEMA_COMPAT_READ_OLD ) === 0
'$mcrMigrationStage',
'Cannot read the old schema when not also writing it.'
);
- Assert::parameter(
- ( $mcrMigrationStage & SCHEMA_COMPAT_READ_NEW ) === 0
- || ( $mcrMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) !== 0,
- '$mcrMigrationStage',
- 'Cannot read the new schema when not also writing it.'
- );
$this->loadBalancer = $loadBalancer;
$this->blobStore = $blobStore;
* 'content'- whether the actual content of the slots should be
* preloaded.
* @param int $queryFlags
- * @param Title|null $title
+ * @param Title|null $title The title to which all the revision rows belong, if there
+ * is such a title and the caller has it handy, so we don't have to look it up again.
+ * If this parameter is given and any of the rows has a rev_page_id that is different
+ * from $title->getArticleID(), an InvalidArgumentException is thrown.
+ *
* @return StatusValue a status with a RevisionRecord[] of successfully fetched revisions
* and an array of errors for the revisions failed to fetch.
*/
$titlesByPageId = [];
foreach ( $rows as $row ) {
if ( isset( $rowsByRevId[$row->rev_id] ) ) {
- throw new InvalidArgumentException( "Duplicate rows in newRevisionsFromBatch {$row->rev_id}" );
+ $result->warning(
+ 'internalerror',
+ "Duplicate rows in newRevisionsFromBatch, rev_id {$row->rev_id}"
+ );
}
if ( $title && $row->rev_page != $title->getArticleID() ) {
throw new InvalidArgumentException(