From a53ab5c56d4d1d0ad970f0cbf1cfef3844872dba Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Wed, 25 Mar 2026 09:50:54 +0100 Subject: [PATCH] Fix(notification): fix missing attachment --- CHANGELOG.md | 1 + inc/notificationevent.class.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1baa7570..70de7307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fix GLIP Stat injection - Fix missing icon - Fix missing categories in `reportSunburstTicketByCategories` chart. +- Fix missing attachment from notification ## [1.9.3] - 2026-01-08 diff --git a/inc/notificationevent.class.php b/inc/notificationevent.class.php index 47611848..eb6d49d1 100644 --- a/inc/notificationevent.class.php +++ b/inc/notificationevent.class.php @@ -75,7 +75,7 @@ class PluginMreportingNotificationEvent extends NotificationEvent * @param array $options options used * @param string $label used for debugEvent() (default '') **/ - public static function raiseEvent($event, $item, $options = [], ?CommonDBTM $trigger = null, $label = '') + public static function raiseEvent($event, $item, $options = [], $label = '') { /** @var array $CFG_GLPI */ global $CFG_GLPI; @@ -87,7 +87,7 @@ public static function raiseEvent($event, $item, $options = [], ?CommonDBTM $tri $options['entities_id'] = 0; //New code $notificationtarget = NotificationTarget::getInstance($item, $event, $options); - if (!$notificationtarget) { + if (!$notificationtarget || !($notificationtarget instanceof PluginMreportingNotificationTargetNotification)) { return false; } @@ -106,6 +106,7 @@ public static function raiseEvent($event, $item, $options = [], ?CommonDBTM $tri $notificationtarget->setMode($data['mode']); $notificationtarget->setEvent($eventClass); $notificationtarget->clearAddressesList(); + $notificationtarget->addDataForTemplate($event, $options); //Process more infos (for example for tickets) $notificationtarget->addAdditionnalInfosForTarget(); @@ -152,7 +153,7 @@ public static function raiseEvent($event, $item, $options = [], ?CommonDBTM $tri $users_infos, $options, ), - [], + $notificationtarget->additionalData, ); } else { $notificationtarget->getFromDB($target['id']);