From 73b7ab5c0180c65730d63fad6e0bbe11f3aec8c3 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 12 May 2024 00:06:29 +0000 Subject: [PATCH] bug fixes --- .github/workflows/greetings.yml | 2 +- Admin/Install/Media.install.json | 44 ---------------------------- Admin/Install/Tag.install.json | 23 +++++++++++++++ Admin/Install/{Media.php => Tag.php} | 6 ++-- Controller/ApiController.php | 10 +++---- info.json | 2 +- 6 files changed, 33 insertions(+), 54 deletions(-) delete mode 100755 Admin/Install/Media.install.json create mode 100644 Admin/Install/Tag.install.json rename Admin/Install/{Media.php => Tag.php} (84%) mode change 100755 => 100644 diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index adb8716..75cb759 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,5 +9,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' + issue-message: 'Thank you for creating this issue. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.' diff --git a/Admin/Install/Media.install.json b/Admin/Install/Media.install.json deleted file mode 100755 index 557ce2b..0000000 --- a/Admin/Install/Media.install.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "type": "type", - "name": "shop_list_image", - "l11n": [ - { - "title": "Shop list image", - "lang": "en" - }, - { - "title": "Shop Listenbild", - "lang": "de" - } - ] - }, - { - "type": "type", - "name": "shop_featured_image", - "l11n": [ - { - "title": "Shop featured image", - "lang": "en" - }, - { - "title": "Shop Featured Bild", - "lang": "de" - } - ] - }, - { - "type": "type", - "name": "shop_primary_image", - "l11n": [ - { - "title": "Shop primary image", - "lang": "en" - }, - { - "title": "Shop Hauptbild", - "lang": "de" - } - ] - } -] \ No newline at end of file diff --git a/Admin/Install/Tag.install.json b/Admin/Install/Tag.install.json new file mode 100644 index 0000000..2e08bf4 --- /dev/null +++ b/Admin/Install/Tag.install.json @@ -0,0 +1,23 @@ +[ + { + "name": "shop_list_image", + "l11n": { + "en": "Shop list image", + "de": "Shop Listenbild" + } + }, + { + "name": "shop_featured_image", + "l11n": { + "en": "Shop featured image", + "de": "Shop Featured Bild" + } + }, + { + "name": "shop_primary_image", + "l11n": { + "en": "Shop primary image", + "de": "Shop Hauptbild" + } + } +] \ No newline at end of file diff --git a/Admin/Install/Media.php b/Admin/Install/Tag.php old mode 100755 new mode 100644 similarity index 84% rename from Admin/Install/Media.php rename to Admin/Install/Tag.php index c66f4a1..d036107 --- a/Admin/Install/Media.php +++ b/Admin/Install/Tag.php @@ -17,14 +17,14 @@ namespace Modules\Shop\Admin\Install; use phpOMS\Application\ApplicationAbstract; /** - * Media class. + * Tag class. * * @package Modules\Shop\Admin\Install * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ -class Media +class Tag { /** * Install media providing @@ -38,6 +38,6 @@ class Media */ public static function install(ApplicationAbstract $app, string $path) : void { - \Modules\Media\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Media.install.json']); + \Modules\Tag\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Tag.install.json']); } } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 49ad21a..56bee12 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -62,15 +62,15 @@ final class ApiController extends Controller /** @var \Modules\ItemManagement\Models\Item $item */ $item = ItemMapper::get() ->with('files') - ->with('files/types') + ->with('files/tags') ->where('id', $request->getDataInt('item')) ->execute(); $itemFiles = $item->files; foreach ($itemFiles as $file) { if ($file->id === $request->getDataInt('id') - && ($file->hasMediaTypeName('item_demo_download') - || $file->hasMediaTypeName('item_public_download')) + && ($file->hasMediaTagName('item_demo_download') + || $file->hasMediaTagName('item_public_download')) ) { $this->app->moduleManager->get('Media', 'Api') ->apiMediaExport($request, $response, ['ignorePermission' => true]); @@ -110,7 +110,7 @@ final class ApiController extends Controller foreach ($files as $file) { if ($file->id === $request->getDataInt('id') - && $file->hasMediaTypeName('item_purchase_download') + && $file->hasMediaTagName('item_purchase_download') ) { $this->app->moduleManager->get('Media', 'Api') ->apiMediaExport($request, $response, ['ignorePermission' => true]); @@ -157,7 +157,7 @@ final class ApiController extends Controller */ public function buildSchema(Item $item, RequestAbstract $request) : array { - $images = $item->getFilesByTypeName('shop_primary_image'); + $images = $item->getFilesByTagName('shop_primary_image'); $schema = [ '@context' => 'https://schema.org/', diff --git a/info.json b/info.json index 412ea7e..d2fc7e4 100755 --- a/info.json +++ b/info.json @@ -25,7 +25,7 @@ }, "providing": { "CMS": "*", - "Media": "*", + "Tag": "*", "Payment": "*" }, "load": [