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

Preview not being updated in backend if you use cache-blocks

    Details

      Description

      If you edit a content in a backend and the template in question has a cache-block, the preview won't be updated.

      Steps to Reproduce

      1. Change ezpublish.yml and set your frontend siteaccess to have legacy_mode: true
      2. Edit your design Full\Article template and add a cache block around the body attribute

        {set-block scope=root variable=cache_ttl}0{/set-block}
        {cache-block keys=$node.contentobject_id expiry=0 ignore_content_expiry subtree_expiry=$node.node_id}
        	{if $node.data_map.body.content.is_empty|not}
        		<div class="attribute-long">
        			{attribute_view_gui attribute=$node.data_map.body}
        		</div>
        	{/if}
        {/cache-block}
        

      3. Clear the caches
      4. Edit an existent article, and change the body.
      5. Preview
      6. Go back to edit
      7. Edit that article again, and change the body again.
      8. Preview

      You won't be able to see content changes this time

        Activity

        Hide
        André Rømcke added a comment -

        Issue described is how cache-blocks works by design, it is not cleared before objects in given subtree is published in this specific example case.

        Closing as invalid.

        Show
        André Rømcke added a comment - Issue described is how cache-blocks works by design, it is not cleared before objects in given subtree is published in this specific example case. Closing as invalid.
        Hide
        Eduardo Fernandes (Inactive) added a comment -

        According to internal discussion, this is the intended behaved and the way the system behaved since its start.

        Even so, it's important to have a note indicating that it's possible to have content not being updated if you preview in the backed templates with cache-blocks. That put, I'm reopening the issue and adding documentation label.

        I'm not sure where this documentation should be add, but at least the following pages should be considered:

        Show
        Eduardo Fernandes (Inactive) added a comment - According to internal discussion, this is the intended behaved and the way the system behaved since its start. Even so, it's important to have a note indicating that it's possible to have content not being updated if you preview in the backed templates with cache-blocks. That put, I'm reopening the issue and adding documentation label. I'm not sure where this documentation should be add, but at least the following pages should be considered: Cache Block Preview
        Hide
        Paulo Nunes (Inactive) added a comment -

        QA Approved

        Show
        Paulo Nunes (Inactive) added a comment - QA Approved

          People

          • Assignee:
            Unassigned
            Reporter:
            Eduardo Fernandes (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour
              1h