Details
-
Bug
-
Resolution: Fixed
-
High
-
2.5.1
-
None
Description
Previewing content which template requests content with hidden location will produce RuntimeError:
An exception has been thrown during the rendering of a template ("Location cannot be displayed as it is flagged as invisible.").
Steps to reproduce
1. Clean installation of Ez Platform 2.5
2. In app/Resources/views create folder_full.html.twig file containing:
<h1>Full - {{ ez_content_name(content) }}</h1> {{ render( controller( "ez_content:viewAction", {'locationId': location.id, 'viewType': 'small'} ) ) }}
and folder_small.html.twig containing:
<h2>Small - {{ ez_content_name(content) }}</h2>
3. In ezplatform.yml set:
ezpublish: #... system: site: content_view: full: folderRuleset: template: folder_full.html.twig match: Identifier\ContentType: [folder] small: folderRuleset: template: folder_small.html.twig match: Identifier\ContentType: [folder]
4. In the back office create a new folder Test Folder. Publish it.
5. Hide Test Folder.
6. Edit Test Folder, go to Preview
Result
RuntimeError:
An exception has been thrown during the rendering of a template ("Location cannot be displayed as it is flagged as invisible.").
Expected Result
Content will be previewed without any exceptions.