From 9fc354138266e195176f950bd6c884a92e1bc51d Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 29 Jan 2017 13:31:15 -0700 Subject: [PATCH] Update device_vendor_function_edit.php Prevent a warning that was discovered in the Admin Training. --- app/devices/device_vendor_function_edit.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/devices/device_vendor_function_edit.php b/app/devices/device_vendor_function_edit.php index 5013403dff..fa3b2a4bb8 100644 --- a/app/devices/device_vendor_function_edit.php +++ b/app/devices/device_vendor_function_edit.php @@ -198,8 +198,8 @@ $sql .= "where device_vendor_function_uuid = '$device_vendor_function_uuid' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - foreach ($result as &$row) { + $device_vendor_functions = $prep_statement->fetchAll(PDO::FETCH_NAMED); + foreach ($device_vendor_functions as &$row) { //$label = $row["label"]; $name = $row["name"]; $value = $row["value"]; @@ -232,9 +232,11 @@ unset($sql, $prep_statement); //set the assigned_groups array - foreach($menu_item_groups as $field) { - if (strlen($field['group_name']) > 0) { - $assigned_groups[] = $field['group_uuid']; + if (is_array($menu_item_groups)) { + foreach($menu_item_groups as $field) { + if (strlen($field['group_name']) > 0) { + $assigned_groups[] = $field['group_uuid']; + } } }