From c49d1ad651e627327bac77167d505464b6d8c3d6 Mon Sep 17 00:00:00 2001 From: Ishiki Date: Mon, 30 Sep 2019 19:45:24 +0300 Subject: [PATCH] ORO CRM shows duplicated activities Activity owners is being set after flush and this triggers Note entity update, and then ORO shows original note and duplicate with message that it has been updated by Admin. In the end having 2 duplicate notes, this might not be a best solution, as src/Oro/Bundle/ActivityListBundle/EventListener/ActivityListListener.php should only be triggered by UI accesable changes, but this listener itself modifies Entity and then triggers update event and in the end duplicate notes popup on the screen. Same goes for all activities. This change will set ActivityOwners at the creation and wont be triggered by ActivityListener and in the end wont show "updated" duplicate. Please advise me with this one, if this solution is wrong. --- .../ActivityListBundle/Provider/ActivityListChainProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Oro/Bundle/ActivityListBundle/Provider/ActivityListChainProvider.php b/src/Oro/Bundle/ActivityListBundle/Provider/ActivityListChainProvider.php index 0a04a0a0592..a99b87dcc06 100644 --- a/src/Oro/Bundle/ActivityListBundle/Provider/ActivityListChainProvider.php +++ b/src/Oro/Bundle/ActivityListBundle/Provider/ActivityListChainProvider.php @@ -455,6 +455,10 @@ protected function getActivityListEntityForEntity( $list->setRelatedActivityId($this->doctrineHelper->getSingleEntityIdentifier($entity)); $list->setOrganization($provider->getOrganization($entity)); } + + foreach ($provider->getActivityOwners() as $activityOwner) { + $list->addActivityOwner($activityOwner); + } $targets = $provider->getTargetEntities($entity); foreach ($targets as $target) {