mirror of
https://github.com/Karaka-Management/oms-Shop.git
synced 2026-02-16 09:48:42 +00:00
bug fixes
This commit is contained in:
parent
16a47b0bd3
commit
73b7ab5c01
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
||||||
- uses: actions/first-interaction@v1
|
- uses: actions/first-interaction@v1
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
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.'
|
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
||||||
|
|
|
||||||
|
|
@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
23
Admin/Install/Tag.install.json
Normal file
23
Admin/Install/Tag.install.json
Normal file
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
6
Admin/Install/Media.php → Admin/Install/Tag.php
Executable file → Normal file
6
Admin/Install/Media.php → Admin/Install/Tag.php
Executable file → Normal file
|
|
@ -17,14 +17,14 @@ namespace Modules\Shop\Admin\Install;
|
||||||
use phpOMS\Application\ApplicationAbstract;
|
use phpOMS\Application\ApplicationAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Media class.
|
* Tag class.
|
||||||
*
|
*
|
||||||
* @package Modules\Shop\Admin\Install
|
* @package Modules\Shop\Admin\Install
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class Media
|
class Tag
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Install media providing
|
* Install media providing
|
||||||
|
|
@ -38,6 +38,6 @@ class Media
|
||||||
*/
|
*/
|
||||||
public static function install(ApplicationAbstract $app, string $path) : void
|
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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -62,15 +62,15 @@ final class ApiController extends Controller
|
||||||
/** @var \Modules\ItemManagement\Models\Item $item */
|
/** @var \Modules\ItemManagement\Models\Item $item */
|
||||||
$item = ItemMapper::get()
|
$item = ItemMapper::get()
|
||||||
->with('files')
|
->with('files')
|
||||||
->with('files/types')
|
->with('files/tags')
|
||||||
->where('id', $request->getDataInt('item'))
|
->where('id', $request->getDataInt('item'))
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$itemFiles = $item->files;
|
$itemFiles = $item->files;
|
||||||
foreach ($itemFiles as $file) {
|
foreach ($itemFiles as $file) {
|
||||||
if ($file->id === $request->getDataInt('id')
|
if ($file->id === $request->getDataInt('id')
|
||||||
&& ($file->hasMediaTypeName('item_demo_download')
|
&& ($file->hasMediaTagName('item_demo_download')
|
||||||
|| $file->hasMediaTypeName('item_public_download'))
|
|| $file->hasMediaTagName('item_public_download'))
|
||||||
) {
|
) {
|
||||||
$this->app->moduleManager->get('Media', 'Api')
|
$this->app->moduleManager->get('Media', 'Api')
|
||||||
->apiMediaExport($request, $response, ['ignorePermission' => true]);
|
->apiMediaExport($request, $response, ['ignorePermission' => true]);
|
||||||
|
|
@ -110,7 +110,7 @@ final class ApiController extends Controller
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if ($file->id === $request->getDataInt('id')
|
if ($file->id === $request->getDataInt('id')
|
||||||
&& $file->hasMediaTypeName('item_purchase_download')
|
&& $file->hasMediaTagName('item_purchase_download')
|
||||||
) {
|
) {
|
||||||
$this->app->moduleManager->get('Media', 'Api')
|
$this->app->moduleManager->get('Media', 'Api')
|
||||||
->apiMediaExport($request, $response, ['ignorePermission' => true]);
|
->apiMediaExport($request, $response, ['ignorePermission' => true]);
|
||||||
|
|
@ -157,7 +157,7 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
public function buildSchema(Item $item, RequestAbstract $request) : array
|
public function buildSchema(Item $item, RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$images = $item->getFilesByTypeName('shop_primary_image');
|
$images = $item->getFilesByTagName('shop_primary_image');
|
||||||
|
|
||||||
$schema = [
|
$schema = [
|
||||||
'@context' => 'https://schema.org/',
|
'@context' => 'https://schema.org/',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user