From 940118967c739acf6393d388a13571382945562c Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Mon, 15 May 2023 09:33:53 +0200 Subject: [PATCH] Move event declaration where the object is defined --- application/datamodel.application.xml | 20 ----------------- .../datamodel.itop-structure.xml | 22 +++++++++++++++++++ sources/Service/Events/EventService.php | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/application/datamodel.application.xml b/application/datamodel.application.xml index bb903757b..20916b9b2 100644 --- a/application/datamodel.application.xml +++ b/application/datamodel.application.xml @@ -488,26 +488,6 @@ - - A document has been downloaded from the GUI - - Document - - - - The object containing the document - DBObject - - - The document downloaded - ormDocument - - - Debug string - string - - - Inform the listeners about the connection states diff --git a/datamodels/2.x/itop-structure/datamodel.itop-structure.xml b/datamodels/2.x/itop-structure/datamodel.itop-structure.xml index 2c58d5507..12f1f5f56 100644 --- a/datamodels/2.x/itop-structure/datamodel.itop-structure.xml +++ b/datamodels/2.x/itop-structure/datamodel.itop-structure.xml @@ -1853,6 +1853,28 @@ + + + A document has been downloaded from the GUI + + Document + + + + The object containing the document + DBObject + + + The document downloaded + ormDocument + + + Debug string + string + + + + 70 diff --git a/sources/Service/Events/EventService.php b/sources/Service/Events/EventService.php index d8887ce2d..d1c1c2ff2 100644 --- a/sources/Service/Events/EventService.php +++ b/sources/Service/Events/EventService.php @@ -340,7 +340,7 @@ final class EventService foreach (self::$aEventDescriptions as $sEvent => $aEventInfo) { if (is_array($aEventInfo['description']->GetEventSources())) { foreach ($aEventInfo['description']->GetEventSources() as $sSource) { - if ($sClass == $sSource || $oClass->isSubclassOf($sSource)) { + if (\MetaModel::IsValidClass($sSource) && ($sClass == $sSource || $oClass->isSubclassOf($sSource))) { $aRes[$sEvent] = $aEventInfo; } }