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

Setting object states and view cache

    XMLWordPrintable

Details

    Description

      Hi. Just starting to play with object states. Found some cache issue setting states from the "view states" template, i mean from "design/admin/templates/states.tpl".

      If you have your "object states" tab enabled and set the states of an object from the view template of the node, you will not notice the changes if you not delete the view cache of the node.

      Quick fix could be change the last lines of the updateObjectState function in kernel/content/ezcontentoperationcollection.php file from

       //call appropriate method from search engine
      eZSearch::updateObjectState($objectID, $selectedStateIDList);
      return array( 'status' => true );
      

      to

       //call appropriate method from search engine
      eZSearch::updateObjectState($objectID, $selectedStateIDList);
      //added to clear cache
      eZContentCacheManager::clearContentCacheIfNeeded( $objectID );
      return array( 'status' => true );
      

      Best wishes.

      Steps to reproduce

      Create a states group.
      Create some states inside that group.
      Enable your object states tabs. Choose a node and try to change the states not editing the content.
      You will no see your changes if you not clear the cache.

      Attachments

        Activity

          People

            andre1 andre1
            desorden desorden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: