Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30508

Previewing content results in an Exception when template renders hidden content/location

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mateusz.bieniek@ibexa.co Mateusz Bieniek
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: