Skip to content

Commit

Permalink
Fix media path
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick477 committed Jun 27, 2018
1 parent 349091f commit abed638
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Controller/Action/Admin/UploadEditorImageAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __invoke(Request $request): Response
return new JsonResponse([
'uploaded' => 1,
'fileName' => $image->getFilename(),
'url' => '/media/image/' . $media->getPath(),
'url' => '/'. $media->getPath(),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ knp_gaufrette:
adapters:
bitbag_sylius_cms_plugin_media:
local:
directory: "%kernel.project_dir%"
directory: "%kernel.project_dir%/web"
create: true
filesystems:
bitbag_sylius_cms_plugin_media:
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/config/services/provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- "@bitbag_sylius_cms_plugin.media_uploader"
- "@templating.engine.twig"
- "@@BitBagSyliusCmsPlugin/Shop/Media/Show/image.html.twig"
- "web/media/image"
- "media/image"
tags:
- { name: bitbag_sylius_cms_plugin.media_provider, type: image, label: bitbag_sylius_cms_plugin.ui.image_provider }

Expand All @@ -15,7 +15,7 @@ services:
- "@bitbag_sylius_cms_plugin.media_uploader"
- "@templating.engine.twig"
- "@@BitBagSyliusCmsPlugin/Shop/Media/Show/video.html.twig"
- "web/media/video"
- "media/video"
tags:
- { name: bitbag_sylius_cms_plugin.media_provider, type: video, label: bitbag_sylius_cms_plugin.ui.video_provider }

Expand All @@ -25,6 +25,6 @@ services:
- "@bitbag_sylius_cms_plugin.media_uploader"
- "@templating.engine.twig"
- "@@BitBagSyliusCmsPlugin/Shop/Media/Show/file.html.twig"
- "web/media/file"
- "media/file"
tags:
- { name: bitbag_sylius_cms_plugin.media_provider, type: file, label: bitbag_sylius_cms_plugin.ui.file_provider }
2 changes: 1 addition & 1 deletion src/Resources/views/Shop/Media/Show/image.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% set path = '/media/image/'~media.path %}
{% set path = '/'~media.path %}

<img class="ui fluid image" src="{{ path }}" alt="{{ media.name }}"/>
2 changes: 1 addition & 1 deletion src/Resources/views/Shop/Media/Show/video.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set path = '/media/image/'~media.path %}
{% set path = '/'~media.path %}

<div>
{% if null != media.name %}
Expand Down

0 comments on commit abed638

Please sign in to comment.