diff --git a/app/devices/app_config.php b/app/devices/app_config.php index 142be962ae..bd7c1d0e57 100644 --- a/app/devices/app_config.php +++ b/app/devices/app_config.php @@ -350,7 +350,7 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'device_uuid'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_id'; - $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the key ID.'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_category'; diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index d356c57f58..1aa6de10fa 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -287,7 +287,7 @@ require_once "resources/require.php"; $sql .= "WHEN 'programmable' THEN 3 "; $sql .= "WHEN 'expansion' THEN 4 "; $sql .= "ELSE 100 END, "; - $sql .= "device_key_id asc "; + $sql .= "cast(device_key_id as numeric) asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $device_keys = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -607,19 +607,11 @@ require_once "resources/require.php"; $selected = "selected='selected'"; echo " \n"; echo "\n";