Details
-
Bug
-
Resolution: Unresolved
-
High
-
None
-
2015.12.1
-
Legacy + New Stack
Description
Hello guys,
We are implementing a kind of workflow based on LegacySearch events like in the eZ Recommendation Bundle:
https://github.com/ezsystems/EzSystemsRecommendationBundle/blob/master/eZ/Publish/LegacySearch/RecommendationLegacySearchEngine.php#L41
It works well but depending on the code that you do in the listener. (let's say a query to get the new added object in the new stack) there is a crash because the new copied object is not yet in the DB. (Content Id not found error)
Indeed the the db->commit is done after the content/publish but the events are sent in the publish... which means that the object is not in the db at this time...
https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/content/copy.php#L102
I looked into the copySubtree and the commit is correctly called before the publish:
https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/content/copysubtree.php#L233
Thank you!