diff --git a/includes/html/forms/schedule-maintenance.inc.php b/includes/html/forms/schedule-maintenance.inc.php
index f359caaf78..10f47414ba 100644
--- a/includes/html/forms/schedule-maintenance.inc.php
+++ b/includes/html/forms/schedule-maintenance.inc.php
@@ -139,7 +139,7 @@ if ($sub_type == 'new-maintenance') {
$fail = 0;
if ($update == 1) {
- dbDelete('alert_schedulables', '`schedule_id`=?', array($schedule_id));
+ dbDelete('alert_schedulables', '`schedule_id`=?', [$alert_schedule->schedule_id]);
}
foreach ($_POST['maps'] as $target) {
@@ -152,7 +152,7 @@ if ($sub_type == 'new-maintenance') {
$target = substr($target, 1);
}
- $item = dbInsert(['schedule_id' => $schedule_id, 'alert_schedulable_type' => $type, 'alert_schedulable_id' => $target], 'alert_schedulables');
+ $item = dbInsert(['schedule_id' => $alert_schedule->schedule_id, 'alert_schedulable_type' => $type, 'alert_schedulable_id' => $target], 'alert_schedulables');
if ($notes && $type = 'device' && get_user_pref('add_schedule_note_to_device', false)) {
$device_notes = dbFetchCell('SELECT `notes` FROM `devices` WHERE `device_id` = ?;', [$target]);
$device_notes.= ((empty($device_notes)) ? '' : PHP_EOL) . date("Y-m-d H:i") . ' Alerts delayed: ' . $notes;
@@ -170,7 +170,7 @@ if ($sub_type == 'new-maintenance') {
dbDelete('alert_schedulables', '`item_id`=?', array($item));
}
- dbDelete('alert_schedule', '`schedule_id`=?', array($schedule_id));
+ dbDelete('alert_schedule', '`schedule_id`=?', [$alert_schedule->schedule_id]);
$message = 'Issue scheduling maintenance';
} else {
$status = 'ok';
diff --git a/includes/html/pages/device/edit/device.inc.php b/includes/html/pages/device/edit/device.inc.php
index fb523c1f7a..e2dd13b8d0 100644
--- a/includes/html/pages/device/edit/device.inc.php
+++ b/includes/html/pages/device/edit/device.inc.php
@@ -307,7 +307,8 @@ If `devices.ignore = 0` or `macros.device = 1` condition is is set and ignore al