Add null check for ownerless tickets
This commit is contained in:
parent
a47068c83b
commit
23040e1745
@ -121,7 +121,7 @@ $sql = "SELECT `ticket`.`id` AS `id`, `ticket`.`trackid` AS `trackid`, `ticket`.
|
||||
`ticket`.`custom17` AS `custom17`, `ticket`.`custom18` AS `custom19`, `ticket`.`custom19` AS `custom19`, `ticket`.`custom20` AS `custom20`,
|
||||
`ticket`.`html` AS `html`
|
||||
FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` AS `ticket`
|
||||
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS `user`
|
||||
LEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS `user`
|
||||
ON `ticket`.`owner` = `user`.`id`
|
||||
WHERE `due_date` IS NOT NULL
|
||||
AND `due_date` <= NOW()
|
||||
|
@ -339,7 +339,9 @@ function mfh_sendOverdueTicketReminder($ticket, $users, $modsForHesk_settings) {
|
||||
$htmlMessage = hesk_processMessage($htmlMessage, $ticket, 1, 1, 0, $modsForHesk_settings, 1);
|
||||
|
||||
$emails = [];
|
||||
if ($ticket['user_email'] != NULL) {
|
||||
$emails[] = $ticket['user_email'];
|
||||
}
|
||||
foreach ($users as $user) {
|
||||
if ($user['email'] != $ticket['user_email']
|
||||
&& ($user['isadmin'] || strpos($user['categories'], $ticket['category']) !== false)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user