From 4f5072850301cf22fdbc491ef53f743c09698750 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 19 May 2023 02:37:35 +0000 Subject: [PATCH] test fixes + new test data --- Admin/Updater.php | 7 +++++++ Controller/ApiController.php | 8 +++----- Theme/Backend/Components/Editor/BaseView.php | 2 +- Theme/Backend/Components/Editor/TextView.php | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Admin/Updater.php b/Admin/Updater.php index 9da7b89..6818ff1 100755 --- a/Admin/Updater.php +++ b/Admin/Updater.php @@ -26,4 +26,11 @@ use phpOMS\Module\UpdaterAbstract; */ final class Updater extends UpdaterAbstract { + /** + * Path of the file + * + * @var string + * @since 1.0.0 + */ + public const PATH = __DIR__; } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index ee4f20f..c74bcab 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -285,14 +285,14 @@ final class ApiController extends Controller foreach ($uploaded as $media) { $accountPath = '/Accounts/' . $account->id . ' ' . $account->login . '/Editor/' - . $doc->createdAt->format('Y') . '/' . $doc->createdAt->format('m') + . $doc->createdAt->format('Y/m') . '/' . $doc->id; if ($collection === null) { $collection = $this->app->moduleManager->get('Media')->createRecursiveMediaCollection( $accountPath, $request->header->account, - __DIR__ . '/../../../Modules/Media/Files/Accounts/' . $account->id . '/Editor/' . $doc->createdAt->format('Y') . '/' . $doc->createdAt->format('m') . '/' . $doc->id + __DIR__ . '/../../../Modules/Media/Files/Accounts/' . $account->id . '/Editor/' . $doc->createdAt->format('Y/m') . '/' . $doc->id ); } @@ -381,9 +381,7 @@ final class ApiController extends Controller private function createEditorDir(EditorDoc $doc) : string { return '/Modules/Editor/' - . $doc->createdAt->format('Y') . '/' - . $doc->createdAt->format('m') . '/' - . $doc->createdAt->format('d') . '/' + . $doc->createdAt->format('Y/m/d') . '/' . $doc->id; } diff --git a/Theme/Backend/Components/Editor/BaseView.php b/Theme/Backend/Components/Editor/BaseView.php index e390042..cb806d9 100755 --- a/Theme/Backend/Components/Editor/BaseView.php +++ b/Theme/Backend/Components/Editor/BaseView.php @@ -37,7 +37,7 @@ class BaseView extends View * @var string * @since 1.0.0 */ - private string $id = ''; + public string $id = ''; /** * {@inheritdoc} diff --git a/Theme/Backend/Components/Editor/TextView.php b/Theme/Backend/Components/Editor/TextView.php index 1b07cf8..95cbe83 100755 --- a/Theme/Backend/Components/Editor/TextView.php +++ b/Theme/Backend/Components/Editor/TextView.php @@ -36,7 +36,7 @@ class TextView extends View * @var string * @since 1.0.0 */ - private string $id = ''; + public string $id = ''; /** * Dom name