FIX: upload all title photos into root directory
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
namespace App\CMS\Pipeline\SavePipeline\Process;
|
||||
|
||||
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||
use App\CMS\Helpers\RootDirectory;
|
||||
use App\Models\Content\Content;
|
||||
use App\Models\FileManager\File;
|
||||
|
||||
class UploadTitlePhoto implements Process {
|
||||
class UploadTitlePhoto implements Process
|
||||
{
|
||||
/**
|
||||
* Process and modify given page
|
||||
*
|
||||
@@ -23,7 +25,10 @@ class UploadTitlePhoto implements Process {
|
||||
$page->titlePhoto = isset($input['existingTitlePhoto']) ? $input['existingTitlePhoto'] : null;
|
||||
|
||||
if (!is_null($titlePhoto)) {
|
||||
$file = $fileModel->upload($titlePhoto);
|
||||
$root = RootDirectory::get();
|
||||
$data = ['directoryId' => $root->id];
|
||||
|
||||
$file = $fileModel->upload($titlePhoto, (object)$data);
|
||||
|
||||
$page->titlePhoto = $file ? $file['filename'] : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user