From f8ec180a0feebdf0c1f22e5cda073cb6aab9bde5 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Fri, 16 Dec 2022 11:42:40 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04756=20-=20Ease=20extensibility=20for=20?= =?UTF-8?q?CRUD=20operations=20:=20Event=20Service=20-=20:green=5Fheart:?= =?UTF-8?q?=20Fix=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/schema.php | 5 +++-- sources/Application/Service/Events/EventService.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/schema.php b/pages/schema.php index 64cde9916..3f93aecf0 100644 --- a/pages/schema.php +++ b/pages/schema.php @@ -274,10 +274,11 @@ function DisplayEvents(WebPage $oPage, $sClass) ]; $aRows = []; foreach ($aEvents as $sEvent => $aEventInfo) { - $aDesc = $aEventInfo['description']; + /** @var \Combodo\iTop\Service\Events\Description\EventDescription $oDesc */ + $oDesc = $aEventInfo['description']; $aRows[] = [ 'event' => $sEvent, - 'description' => $aDesc['description'] ?? '', + 'description' => $oDesc->GetDescription(), ]; } $oTable = DataTableUIBlockFactory::MakeForStaticData(Dict::S('UI:Schema:Events:Defined'), $aColumns, $aRows); diff --git a/sources/Application/Service/Events/EventService.php b/sources/Application/Service/Events/EventService.php index 6abcc2fcd..d780b8925 100644 --- a/sources/Application/Service/Events/EventService.php +++ b/sources/Application/Service/Events/EventService.php @@ -309,8 +309,8 @@ class EventService $aRes = []; $oClass = new ReflectionClass($sClass); foreach (self::$aEventDescription as $sEvent => $aEventInfo) { - if (is_array($aEventInfo['description']->GetSources())) { - foreach ($aEventInfo['description']->GetSources() as $sSource) { + if (is_array($aEventInfo['description']->GetEventSources())) { + foreach ($aEventInfo['description']->GetEventSources() as $sSource) { if ($sClass == $sSource || $oClass->isSubclassOf($sSource)) { $aRes[$sEvent] = $aEventInfo; }