Move event declaration where the object is defined

This commit is contained in:
Eric Espie
2023-05-15 09:33:53 +02:00
parent a647c235c3
commit 940118967c
3 changed files with 23 additions and 21 deletions

View File

@@ -488,26 +488,6 @@
</event_datum>
</event_data>
</event>
<event id="EVENT_DOWNLOAD_DOCUMENT" _delta="define">
<description>A document has been downloaded from the GUI</description>
<sources>
<source id="Document">Document</source>
</sources>
<event_data>
<event_datum id="object">
<description>The object containing the document</description>
<type>DBObject</type>
</event_datum>
<event_datum id="document">
<description>The document downloaded</description>
<type>ormDocument</type>
</event_datum>
<event_datum id="debug_info">
<description>Debug string</description>
<type>string</type>
</event_datum>
</event_data>
</event>
<event id="EVENT_LOGIN" _delta="define">
<description>Inform the listeners about the connection states</description>
<event_data>

View File

@@ -1853,6 +1853,28 @@
</presentation>
</class>
</classes>
<events>
<event id="EVENT_DOWNLOAD_DOCUMENT" _delta="define">
<description>A document has been downloaded from the GUI</description>
<sources>
<source id="Document">Document</source>
</sources>
<event_data>
<event_datum id="object">
<description>The object containing the document</description>
<type>DBObject</type>
</event_datum>
<event_datum id="document">
<description>The document downloaded</description>
<type>ormDocument</type>
</event_datum>
<event_datum id="debug_info">
<description>Debug string</description>
<type>string</type>
</event_datum>
</event_data>
</event>
</events>
<menus>
<menu id="DataAdministration" xsi:type="MenuGroup" _delta="define">
<rank>70</rank>

View File

@@ -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;
}
}