X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=blobdiff_plain;f=includes%2FRevision%2FRevisionStore.php;h=c444cc4e7d654e5df84b6a9515beeff8329c2f85;hb=9d2d6089938254118b2e5eb16e377fda0979bb41;hp=3ecef76fa030fd29799a060b4df41564c5f9fbb5;hpb=31f66267ae9763dcecd44c1e749fe0e91b5a3a01;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Revision/RevisionStore.php b/includes/Revision/RevisionStore.php index 3ecef76fa0..c444cc4e7d 100644 --- a/includes/Revision/RevisionStore.php +++ b/includes/Revision/RevisionStore.php @@ -182,9 +182,9 @@ class RevisionStore '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 @@ -192,12 +192,6 @@ class RevisionStore '$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; @@ -1907,7 +1901,11 @@ class RevisionStore * '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. */ @@ -1924,7 +1922,10 @@ class RevisionStore $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(