mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Enhancement add notice for MigrateFileTask if FileMigrationHelper doesn't exist
Enhancement add call to image thumbnail helper to generate thumbnails
This commit is contained in:
parent
fe98555d0a
commit
36397c787c
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\Dev\Tasks;
|
||||
|
||||
use SilverStripe\AssetAdmin\Helper\ImageThumbnailHelper;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\Assets\FileMigrationHelper;
|
||||
use SilverStripe\Dev\BuildTask;
|
||||
@ -21,11 +22,23 @@ class MigrateFileTask extends BuildTask
|
||||
|
||||
public function run($request)
|
||||
{
|
||||
if (!class_exists(FileMigrationHelper::class)) {
|
||||
DB::alteration_message("No file migration helper detected", "notice");
|
||||
return;
|
||||
}
|
||||
|
||||
$migrated = FileMigrationHelper::singleton()->run();
|
||||
if ($migrated) {
|
||||
DB::alteration_message("{$migrated} File DataObjects upgraded", "changed");
|
||||
} else {
|
||||
DB::alteration_message("No File DataObjects need upgrading", "notice");
|
||||
}
|
||||
|
||||
if (!class_exists(ImageThumbnailHelper::class)) {
|
||||
DB::alteration_message("No image thumbnail helper detected", "notice");
|
||||
return;
|
||||
}
|
||||
|
||||
ImageThumbnailHelper::singleton()->run();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user