From ea7294f7d5b1ca9baf798a5457a97a2d04598a43 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 16 Dec 2019 15:30:18 +0100 Subject: [PATCH 1/2] do not add (user) flows twice Signed-off-by: Arthur Schiwon --- apps/workflowengine/lib/Service/RuleMatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php index b08bcbbe56b55..6186df1d7b959 100644 --- a/apps/workflowengine/lib/Service/RuleMatcher.php +++ b/apps/workflowengine/lib/Service/RuleMatcher.php @@ -124,7 +124,7 @@ public function getMatchingOperations(string $class, bool $returnFirstMatchingOp $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class); foreach ($additionalScopes as $hash => $scopeCandidate) { /** @var ScopeContext $scopeCandidate */ - if ($scopeCandidate->getScope() !== IManager::SCOPE_USER) { + if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) { continue; } if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) { From 8b18b0c97d5c3a915bffaf33c50780ecdc0d297d Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 16 Dec 2019 15:30:50 +0100 Subject: [PATCH 2/2] lower to debug, since we fire two events, so it is legitimate Signed-off-by: Arthur Schiwon --- apps/workflowengine/lib/AppInfo/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php index 2d04e2a1bf9f7..74a7c841ee79d 100644 --- a/apps/workflowengine/lib/AppInfo/Application.php +++ b/apps/workflowengine/lib/AppInfo/Application.php @@ -110,7 +110,7 @@ function ($event) use ($eventName, $operationClass, $entityClass) { $operation->onEventCompat($eventName, $event, $ruleMatcher); } else { $logger = $this->getContainer()->getServer()->getLogger(); - $logger->warning( + $logger->debug( 'Cannot handle event {name} of {event} against entity {entity} and operation {operation}', [ 'app' => self::APP_ID,