Bug description
When GLPI processes ticket notifications, the following warning is repeatedly logged in php-errors.log:
[2026-02-18 16:25:13] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "survey_reminder"
in /usr/share/glpi/src/NotificationTargetCommonITILObject.php at line 107
Root cause
In inc/notificationtargetticket.class.php, the addEvents() method assigns the survey_reminder
key to $target->events without first checking if it already exists:
static function addEvents(NotificationTargetTicket $target) {
$target->events['survey_reminder']
= __('Survey Reminder', 'satisfaction');
}
Under PHP 8.2, accessing an array key that has not been initialized triggers an Undefined array key
warning. This happens when GLPI core reads $target->events in contexts where the plugin hooks
have not yet fully initialized (e.g. cron jobs, CLI execution).
Fix
Add an isset() check before assigning the key:
static function addEvents(NotificationTargetTicket $target) {
if (!isset($target->events['survey_reminder'])) {
$target->events['survey_reminder']
= __('Survey Reminder', 'satisfaction');
}
}
Environment
- Plugin version: 1.6.2
- GLPI version: 10.0.23
- PHP version: 8.2
Regards
Giovanny Rodriguez
Imagunet Colombia
Bug description
When GLPI processes ticket notifications, the following warning is repeatedly logged in
php-errors.log:[2026-02-18 16:25:13] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "survey_reminder"
in /usr/share/glpi/src/NotificationTargetCommonITILObject.php at line 107
Root cause
In
inc/notificationtargetticket.class.php, theaddEvents()method assigns thesurvey_reminderkey to
$target->eventswithout first checking if it already exists:Under PHP 8.2, accessing an array key that has not been initialized triggers an
Undefined array keywarning. This happens when GLPI core reads
$target->eventsin contexts where the plugin hookshave not yet fully initialized (e.g. cron jobs, CLI execution).
Fix
Add an
isset()check before assigning the key:Environment
Regards
Giovanny Rodriguez
Imagunet Colombia