From: daniel Date: Mon, 28 Oct 2019 20:09:44 +0000 (+0100) Subject: WikiExporter: Remove unnecessary check for SCHEMA_COMPAT_WRITE_OLD flag X-Git-Tag: 1.34.0~20 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/User:Test/%27http:/jquery.khurshid.com/ifixpng.php/%40%20%27info_etape_suivante_2%27%20=%3E%20%27You%20can%20move%20on%20to%20the%20next%20step.%27%2C%20%27info_exceptions_proxy%27%20=%3E%20%27Exceptions%20for%20the%20proxy%27%2C%20%27info_exportation_base%27%20=%3E%20%27export%20database%20to%20%40archive%40%27%2C-%27info_facilite_suivi_activite%27%20=%3E%20%27To%20simplify%20monitoring%20of%20the%20site/%27s%20editorial;-%20%20activities%2C%20SPIP%20can%20send%20rmail%20notifications%2C%20e.g.%20to%20an%20editors/%27%20mailing%20list%2C%20%27info_facilite_suivi_activite%27%20=%3E%20%27To%20simplify%20monitoring%20of%20the%20site%C3%A2%C2%80%C2%99s%20editorial;%20%20%20activities%2C%20SPIP%20can%20send%20rmail%20notifications%2C%20e.g.%20to%20an%20editors%C3%A2%C2%80%C2%99%20mailing%20list%2C%20%20%20of%20publication%20requests%20and%20article%20validations.%27%2C%20%27info_fichiers_authent%27%20=%3E%20%27Authentication%20file?a=commitdiff_plain;h=ccb2bb29951ac88ac29ab52a4319788f5b6081c3;p=lhc%2Fweb%2Fwiklou.git WikiExporter: Remove unnecessary check for SCHEMA_COMPAT_WRITE_OLD flag WikiExporter used to require SCHEMA_COMPAT_WRITE_OLD to be enabled, until that requirement was fixed in I5ea972bb07ca1cfb3a2ad8ef120aef7. However, I failed to remove the explicit check for the flag at the time, causing all exports to fail in SCHEMA_COMPAT_NEW mode. This change removes the obsolete check. Bug: T236735 Change-Id: I809ed4e2f1f30fdc4bd817f815d733d8a62f3d4f (cherry picked from commit d9209707cc62ea2eb0f0fe9d2c79e56a8cc87552) --- diff --git a/includes/export/WikiExporter.php b/includes/export/WikiExporter.php index fd200d1fbb..51a187070a 100644 --- a/includes/export/WikiExporter.php +++ b/includes/export/WikiExporter.php @@ -351,15 +351,6 @@ class WikiExporter { * @throws Exception */ protected function dumpPages( $cond, $orderRevs ) { - global $wgMultiContentRevisionSchemaMigrationStage; - if ( !( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) { - // TODO: Make XmlDumpWriter use a RevisionStore! (see T198706 and T174031) - throw new MWException( - 'Cannot use WikiExporter with SCHEMA_COMPAT_WRITE_OLD mode disabled!' - . ' Support for dumping from the new schema is not implemented yet!' - ); - } - $revQuery = MediaWikiServicesAlias::getInstance()->getRevisionStore()->getQueryInfo( [ 'page' ] ); diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php index 54a362e705..1b67179760 100644 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ b/tests/phpunit/maintenance/backup_PageTest.php @@ -136,11 +136,7 @@ class BackupDumperPageTest extends DumpTestCase { if ( ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) { $this->db->update( 'revision', - [ - 'rev_text_id' => 0, - 'rev_sha1' => '', - 'rev_len' => '0', - ], + [ 'rev_text_id' => 0 ], [ 'rev_id' => $revision->getId() ] ); } @@ -148,11 +144,7 @@ class BackupDumperPageTest extends DumpTestCase { if ( ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) ) { $this->db->update( 'content', - [ - 'content_address' => 'tt:0', - 'content_sha1' => '', - 'content_size' => '0', - ], + [ 'content_address' => 'tt:0' ], [ 'content_id' => $revision->getSlot( SlotRecord::MAIN )->getContentId() ] ); } @@ -337,8 +329,7 @@ class BackupDumperPageTest extends DumpTestCase { "Talk about BackupDumperTestP1 Text1", false, CONTENT_MODEL_WIKITEXT, - CONTENT_FORMAT_WIKITEXT, - $schemaVersion + CONTENT_FORMAT_WIKITEXT ); $asserter->assertPageEnd(); @@ -352,13 +343,12 @@ class BackupDumperPageTest extends DumpTestCase { $this->revId5_1, "BackupDumperTestP5 Summary1", null, - 0, - "", + 24, + "d2vipufvkfs9wfruwjfj8eschxw0fbl", false, false, CONTENT_MODEL_WIKITEXT, - CONTENT_FORMAT_WIKITEXT, - $schemaVersion + CONTENT_FORMAT_WIKITEXT ); $asserter->assertPageEnd(); @@ -484,8 +474,8 @@ class BackupDumperPageTest extends DumpTestCase { $this->revId5_1, "BackupDumperTestP5 Summary1", null, - 0, - "" + 24, + "d2vipufvkfs9wfruwjfj8eschxw0fbl" ); $asserter->assertPageEnd();