* @since 1.30
* @var int One of the MIGRATION_* constants
*/
-$wgCommentTableSchemaMigrationStage = MIGRATION_OLD;
+$wgCommentTableSchemaMigrationStage = MIGRATION_NEW;
/**
* RevisionStore table schema migration stage (content, slots, content_models & slot_roles tables).
$this->setMwGlobals( [
'wgMultiContentRevisionSchemaMigrationStage' => $this->getMcrMigrationStage(),
'wgContentHandlerUseDB' => $this->getContentHandlerUseDB(),
- 'wgCommentTableSchemaMigrationStage' => MIGRATION_OLD,
+ 'wgCommentTableSchemaMigrationStage' => MIGRATION_NEW,
'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_OLD,
] );
$this->setMwGlobals( [
'wgMultiContentRevisionSchemaMigrationStage' => $this->getMcrMigrationStage(),
'wgContentHandlerUseDB' => $this->getContentHandlerUseDB(),
- 'wgCommentTableSchemaMigrationStage' => MIGRATION_OLD,
+ 'wgCommentTableSchemaMigrationStage' => MIGRATION_NEW,
'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_OLD,
] );
* @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
*/
public function testConstructFromRowWithBadPageId() {
- $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+ $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_NEW );
$this->overrideMwServices();
Wikimedia\suppressWarnings();
- $rev = new Revision( (object)[ 'rev_page' => 77777777 ] );
+ $rev = new Revision( (object)[
+ 'rev_page' => 77777777,
+ 'rev_comment_text' => '',
+ 'rev_comment_data' => null,
+ ] );
$this->assertSame( 77777777, $rev->getPage() );
Wikimedia\restoreWarnings();
}
* @covers Revision::loadFromTitle
*/
public function testLoadFromTitle() {
- $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+ $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_NEW );
$this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_OLD );
$this->overrideMwServices();
$title = $this->getMockTitle();
$db->expects( $this->once() )
->method( 'selectRow' )
->with(
- $this->equalTo( [ 'revision', 'page', 'user' ] ),
+ $this->equalTo( [
+ 'revision', 'page', 'user',
+ 'temp_rev_comment' => 'revision_comment_temp', 'comment_rev_comment' => 'comment',
+ ] ),
// We don't really care about the fields are they come from the selectField methods
$this->isType( 'array' ),
$this->equalTo( $conditions ),
'ar_page_id' => strval( $this->ipRev->getPageId() ),
'ar_comment_text' => 'just a test',
'ar_comment_data' => null,
- 'ar_comment_cid' => null,
+ 'ar_comment_cid' => '2',
'ts_tags' => null,
'ar_id' => '2',
'ar_namespace' => '0',
'ar_page_id' => strval( $this->firstRev->getPageId() ),
'ar_comment_text' => 'testing',
'ar_comment_data' => null,
- 'ar_comment_cid' => null,
+ 'ar_comment_cid' => '1',
'ts_tags' => null,
'ar_id' => '1',
'ar_namespace' => '0',
'ar_page_id' => strval( $this->ipRev->getPageId() ),
'ar_comment_text' => 'just a test',
'ar_comment_data' => null,
- 'ar_comment_cid' => null,
+ 'ar_comment_cid' => '2',
'ar_content_format' => null,
'ar_content_model' => null,
'ts_tags' => null,
'ar_page_id' => strval( $this->firstRev->getPageId() ),
'ar_comment_text' => 'testing',
'ar_comment_data' => null,
- 'ar_comment_cid' => null,
+ 'ar_comment_cid' => '1',
'ar_content_format' => null,
'ar_content_model' => null,
'ts_tags' => null,
[
'page',
'revision',
+ 'revision_comment_temp',
'ip_changes',
'text',
'archive',
'recentchanges',
'logging',
'page_props',
+ 'comment',
]
);
}
$this->tablesUsed += $this->getMcrTablesToReset();
- $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+ $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_NEW );
$this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_OLD );
$this->setMwGlobals( 'wgContentHandlerUseDB', $this->getContentHandlerUseDB() );
$this->setMwGlobals(
);
$logId = $status->getValue();
$actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+ $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
$this->assertSelect(
- [ 'logging' ] + $actorQuery['tables'], /* table */
+ [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'], /* table */
[
'log_type',
'log_action',
- 'log_comment',
+ 'log_comment' => $commentQuery['fields']['log_comment_text'],
'log_user' => $actorQuery['fields']['log_user'],
'log_user_text' => $actorQuery['fields']['log_user_text'],
'log_namespace',
$page->getTitle()->getDBkey(),
] ],
[],
- $actorQuery['joins']
+ $actorQuery['joins'] + $commentQuery['joins']
);
}
);
$logId = $status->getValue();
$actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+ $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
$this->assertSelect(
- [ 'logging' ] + $actorQuery['tables'], /* table */
+ [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'], /* table */
[
'log_type',
'log_action',
- 'log_comment',
+ 'log_comment' => $commentQuery['fields']['log_comment_text'],
'log_user' => $actorQuery['fields']['log_user'],
'log_user_text' => $actorQuery['fields']['log_user_text'],
'log_namespace',
$page->getTitle()->getDBkey(),
] ],
[],
- $actorQuery['joins']
+ $actorQuery['joins'] + $commentQuery['joins']
);
}
);
$logId = $status->getValue();
$actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+ $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
$this->assertSelect(
- [ 'logging' ] + $actorQuery['tables'], /* table */
+ [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'], /* table */
[
'log_type',
'log_action',
- 'log_comment',
+ 'log_comment' => $commentQuery['fields']['log_comment_text'],
'log_user' => $actorQuery['fields']['log_user'],
'log_user_text' => $actorQuery['fields']['log_user_text'],
'log_namespace',
$page->getTitle()->getDBkey(),
] ],
[],
- $actorQuery['joins']
+ $actorQuery['joins'] + $commentQuery['joins']
);
$this->assertNull(
// Make sure the log entry looks good
// log_params is not checked here
$actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+ $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
$this->assertSelect(
- [ 'logging' ] + $actorQuery['tables'],
+ [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'],
[
- 'log_comment',
+ 'log_comment' => $commentQuery['fields']['log_comment_text'],
'log_user' => $actorQuery['fields']['log_user'],
'log_user_text' => $actorQuery['fields']['log_user_text'],
'log_namespace',
$page->getTitle()->getDBkey(),
] ],
[],
- $actorQuery['joins']
+ $actorQuery['joins'] + $commentQuery['joins']
);
}