Details
-
Bug
-
Resolution: Fixed
-
Medium
-
5.4.0, 5.4.1
-
None
-
eZ Publish 5.4.0
Description
When linking to a file located under storage/original/application/ the following exception is thrown:
CRITICAL - Uncaught PHP Exception eZ\Publish\Core\Base\Exceptions\InvalidArgumentException: "Argument '$id' is invalid: Prefix images not found in original/application/deccb8d2bfc81d6da0df8eb956d83a17.pdf" at /var/www/ezpublish54/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/IOService.php line 386
Steps to reproduce:
Start from an eZ Publish 5.4 site with eZ Demo frontend.
1. Add the following twig template at vendor/ezsystems/demobundle/EzSystems/DemoBundle/Resources/views/full/file.html.twig:
{# File (test) - full view #} {% extends "eZDemoBundle::pagelayout.html.twig" %} {% block content %} <h1>File: {{ ez_field_value(content, "file").uri }}</h1> <br><a href="{{ ez_field_value(content, "file").uri }}">Link</a> {% endblock %}
2. Add the file template definition on vendor/ezsystems/demobundle/EzSystems/DemoBundle/Resources/config/ezdemo.yml after the article template definition:
file: controller: "eZDemoBundle:Demo:showArticle" template: "eZDemoBundle:full:file.html.twig" match: Identifier\ContentType: [file]
3. Clear all caches
4. Login to the administration backend and create a new File content object
5. Add a .PDF file to it, and publish it
6. From your eZ Demo frontend access the File content object you just created
7. Click on the link on page to access to PDF
You will get a Symfony error as follows:
Argument '$id' is invalid: Prefix images not found in original/application/deccb8d2bfc81d6da0df8eb956d83a17.pdf
Attachments
Issue Links
- relates to
-
EZP-23550 Missing /content/download controller to deal with files
-
- Closed
-