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

View Cache for related objects is not properly cleared

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.10.1, 3.9.5, 4.0.0alpha2
    • 3.9.2
    • Caching
    • None
    • Operating System: tested on MacOS and Linux
      PHP Version: (please be specific, like '4.4.3' or '5.1.5') : 4.4.7
      Database and version: MySQL 5.0.25
      Browser (and version): FF, Opera, Safari

    Description

      View Caching is not cleared for objects which were related in the previous version of the object and are not anymode in the current one.
      Ex :
      We created an object, containing an 'object relation list' attribute :

      • version 1 : object is related to nodes 45 and 57, their respective view cachings get cleared upon publishing.
      • version 2 : these object relations are removed, view cache is not cleared for nodes 45 and 57, while it needs to be updated

      The typical use case is when a folder lists its reverse related objects. If these reverse relations are removed, the view cache of this folder is not updated, thus displaying a list of reverse related objects which are actually not anymore.

      Please find attached a patch that solves this issue.
      Thanks.

      Steps to reproduce
      • Create a simple content class with a title and an attribute of the datatype 'objectrelations' ( i chose Selection method : List with Check boxes )
      • Create a few folders in your content tree
      • Add these lines at the top of the template override for folders :
        <snip>
        <h1>Folder - Full view - Reverse related objects</h1> {def $related_objects=fetch( 'content', 'reverse_related_objects', hash( 'object_id', $node.object.id, 'all_relations', true() ))} {foreach $related_objects as $object}

        {$object.name}<br />

        {/foreach}

        </snip>

      • Make sure view caching is on
      • Create an instance of your newly created content class, and relate it to a folder
      • Display the folder in say your public siteaccess, it should display the name of the freshly created object
      • Edit this new object again, and remove the relation to the folder, publish.
      • Refresh the folder page : you should still see on the top of the page the name of the your test object, meaning that view cache was not cleared for the related folder.

      Attachments

        Activity

          People

            oms Ole Marius Smestad
            nfrp nfrp
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: