-
-
Notifications
You must be signed in to change notification settings - Fork 436
When rendering forms, missing default value can cause errors #5780
Copy link
Copy link
Closed
Labels
bugUndesired behaviourUndesired behaviourconfirmedBug is confirm by dev teamBug is confirm by dev teamresolvedA fixed issueA fixed issue
Milestone
Description
CACTI version [1.3.0 - Dev]
The below error occurs when attempting to edit a threshold.
2024-06-26 18:19:34 - PHP ERROR WARNING Backtrace: (D:\cacti\apache\htdocs\cacti\plugins\thold\thold.php[144]:thold_edit(), D:\cacti\apache\htdocs\cacti\plugins\thold\thold.php[2266]:draw_edit_form(), D:\cacti\apache\htdocs\cacti\lib\html_form.php[56]:CactiErrorHandler())
2024-06-26 18:19:34 - ERROR PHP WARNING: Undefined array key "default" in file: D:\cacti\apache\htdocs\cacti\lib\html_form.php on line: 56
Root Cause:
Some hidden config fields do not have array key 'default'
The error occurs at line 56
$field_array['value'] = $field_array['default'];
Solution:
Replace line 56 with:
//$field_array['value'] = $field_array['default'];
if (array_key_exists('default', $field_array)) {
$field_array['value'] = $field_array['default'];
} else {
$field_array['value'] = '';
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugUndesired behaviourUndesired behaviourconfirmedBug is confirm by dev teamBug is confirm by dev teamresolvedA fixed issueA fixed issue