eZ Community » Forums » Developer » LocationService returns previous...

LocationService returns previous version of content on content/publish/after

LocationService returns previous version of content on content/publish/after

Wednesday 08 April 2015 3:11:58 pm - 3 replies


In my eZ (5.1) environment I have a workflow that starts on content/publish/after.
In that workflow I am fetching the current location element like so:

 $object = eZContentObjectTreeNode::fetchByContentObjectId($parameters['object_id'], false);
// get symfony
$container = ezpKernel::instance()->getServiceContainer();
$repository = $container->get('ezpublish.api.repository');
// load location
$location = $repository->getLocationService()->loadLocation($object[0]['main_node_id']);

Problem is here, that I always get the previous version of the object. e.g. when I have created version 10, the $location output shows version 9.

Do you have any idea what could be wrong?

Thanks in advance.


Wednesday 08 April 2015 3:30:16 pm

Hm... I got it.
Last week I switched off legacy caches (via site.ini). That caused the problem. I don't know why... I re-activated the caches and now it's running. 

Monday 20 April 2015 1:17:38 pm

Hi Phillip.

SPI (persistence) cache is cleaned during ViewCache clearing, that's why. If you disable ViewCache, you end up with invalid caches. It is annoying, but once you know about it, it should be manageable.

Monday 20 April 2015 1:56:24 pm

Thanks Bertrand.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from