From 4d5a704d9a09447417567d5960710101ee72a484 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Mon, 13 Nov 2023 15:14:29 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B06062=20-=20:white=5Fcheck=5Fmark:=20Fix?= =?UTF-8?q?=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobject.class.php | 4 +++- sources/Service/Events/EventService.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index b8ba24623..b355b1e87 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -9,6 +9,7 @@ use Combodo\iTop\Service\Events\EventData; use Combodo\iTop\Service\Events\EventException; use Combodo\iTop\Service\Events\EventService; use Combodo\iTop\Service\Events\EventServiceLog; +use Combodo\iTop\Service\Module\ModuleService; use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectManager; /** @@ -6286,7 +6287,8 @@ abstract class DBObject implements iDisplay } finally { if (!$oKPI->ComputeStatsForExtension($this, $sCallback, "Event: $sEvent")) { - $oKPI->ComputeStats('FireEvent', $sEvent); + $sSignature = ModuleService::GetInstance()->GetModuleMethodSignature($this, $sCallback); + $oKPI->ComputeStats('FireEvent', "$sEvent callback: $sSignature"); } } } diff --git a/sources/Service/Events/EventService.php b/sources/Service/Events/EventService.php index 8a632297a..60b5cc9c2 100644 --- a/sources/Service/Events/EventService.php +++ b/sources/Service/Events/EventService.php @@ -159,7 +159,7 @@ final class EventService call_user_func($aEventCallback['callback'], $oEventData); - if (isset($aEventCallback['callback'][1]) && !$oKPI->ComputeStatsForExtension($aEventCallback['callback'][0], $aEventCallback['callback'][1], "Event: $sEvent")) { + if (is_array($aEventCallback['callback']) && !$oKPI->ComputeStatsForExtension($aEventCallback['callback'][0], $aEventCallback['callback'][1], "Event: $sEvent")) { $sSignature = ModuleService::GetInstance()->GetModuleMethodSignature($aEventCallback['callback'][0], $aEventCallback['callback'][1]); $oKPI->ComputeStats('FireEvent', "$sEvent callback: $sSignature"); }