* @return Revision
*/
public static function newFromArchiveRow( $row, $overrides = [], Title $title = null ) {
+ /**
+ * MCR Migration: https://phabricator.wikimedia.org/T183564
+ * This method used to overwrite attributes, then passed to Revision::__construct
+ * RevisionStore::newRevisionFromArchiveRow instead overrides row field names
+ * So do a conversion here.
+ */
+ if ( array_key_exists( 'page', $overrides ) ) {
+ $overrides['page_id'] = $overrides['page'];
+ unset( $overrides['page'] );
+ }
+
$rec = self::getRevisionStore()->newRevisionFromArchiveRow( $row, 0, $title, $overrides );
return new Revision( $rec, self::READ_NORMAL, $title );
}
&& $this->mPageId !== $this->mTitle->getArticleID()
) {
throw new InvalidArgumentException(
- 'The given Title does not belong to page ID ' . $this->mPageId
+ 'The given Title does not belong to page ID ' . $this->mPageId .
+ ' but actually belongs to ' . $this->mTitle->getArticleID()
);
}
}