diff --git a/src/File.php b/src/File.php index 8dc73e4f..415f0a8c 100644 --- a/src/File.php +++ b/src/File.php @@ -255,14 +255,6 @@ class File extends DataObject implements AssetContainer, Thumbnail, CMSPreviewab */ private static $apply_restrictions_to_admin = true; - /** - * If enabled, legacy file dataobjects will be automatically imported into the APL - * - * @config - * @var bool - */ - private static $migrate_legacy_file = false; - /** * @config * @var boolean @@ -1206,21 +1198,6 @@ public function getTag() return (string)$this->renderWith($template); } - public function requireDefaultRecords() - { - parent::requireDefaultRecords(); - - // Check if old file records should be migrated - if (!$this->config()->get('migrate_legacy_file')) { - return; - } - - $migrated = FileMigrationHelper::singleton()->run(); - if ($migrated) { - DB::alteration_message("{$migrated} File DataObjects upgraded", "changed"); - } - } - /** * Get the back-link tracking objects that link to this file via HTML fields * diff --git a/tests/php/Dev/Tasks/FileMigrationHelperTest.php b/tests/php/Dev/Tasks/FileMigrationHelperTest.php index cc9efd1f..c5086319 100644 --- a/tests/php/Dev/Tasks/FileMigrationHelperTest.php +++ b/tests/php/Dev/Tasks/FileMigrationHelperTest.php @@ -43,8 +43,6 @@ protected function getBasePath() public function setUp() { - Config::nest(); // additional nesting here necessary - Config::modify()->merge(File::class, 'migrate_legacy_file', false); parent::setUp(); // Set backend root to /FileMigrationHelperTest/assets @@ -77,7 +75,6 @@ public function tearDown() TestAssetStore::reset(); Filesystem::removeFolder($this->getBasePath()); parent::tearDown(); - Config::unnest(); } /** diff --git a/tests/php/LegacyThumbnailMigrationHelperTest.php b/tests/php/LegacyThumbnailMigrationHelperTest.php index f0b9a491..a40356a7 100644 --- a/tests/php/LegacyThumbnailMigrationHelperTest.php +++ b/tests/php/LegacyThumbnailMigrationHelperTest.php @@ -43,8 +43,6 @@ protected function getBasePath() public function setUp() { - Config::nest(); // additional nesting here necessary - Config::modify()->merge(File::class, 'migrate_legacy_file', false); parent::setUp(); // Set backend root to /LegacyThumbnailMigrationHelperTest/assets @@ -68,7 +66,6 @@ public function tearDown() TestAssetStore::reset(); Filesystem::removeFolder($this->getBasePath()); parent::tearDown(); - Config::unnest(); } public function testMigratesThumbnailsForProtectedFiles()