N°8911 - Attachment visualisation broken

This commit is contained in:
Anne-Cath
2025-11-20 08:06:00 +01:00
parent 4a6b129eb8
commit f266f5ff36

View File

@@ -67,15 +67,17 @@ class EventListener implements iEventServiceSetup
/** @var \DBObject $oAttachment */
$oAttachment = $oEventData->Get('object');
$oHostObj = MetaModel::GetObject($oAttachment->Get('item_class'), $oAttachment->Get('item_id'), false /* false to avoid exception during trigger */, true);
/** @var \ormDocument $oDocument */
$oDocument = $oEventData->Get('document');
if ($oHostObj != null) {
/** @var \ormDocument $oDocument */
$oDocument = $oEventData->Get('document');
$this->OnAttachmentActivateTriggers(
$oHostObj,
$oAttachment,
$oDocument,
TriggerOnAttachmentDownload::class
);
$this->OnAttachmentActivateTriggers(
$oHostObj,
$oAttachment,
$oDocument,
TriggerOnAttachmentDownload::class
);
}
}
/**