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

    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.

        Activity

        Show
        Mateusz Bieniek added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/2623
        Hide
        Michał Szołtysek added a comment -

        QA Approved on eZ Platform EE v2.5.1 with diff.

        Show
        Michał Szołtysek added a comment - QA Approved on eZ Platform EE v2.5.1 with diff.
        Show
        Michał Szołtysek added a comment - Merged to 7.5: https://github.com/ezsystems/ezpublish-kernel/commit/781a2b5c6103d2c66a6416b7b47f927df1bec3db

          People

          • Assignee:
            Unassigned
            Reporter:
            Mateusz Bieniek
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: