mirror of
https://github.com/Cacti/cacti.git
synced 2026-10-23 03:27:02 +09:00
fix(automation): render new Graph and Tree rule items without TypeErrors (#8283)
* fix(automation): normalize empty IDs in rule item editors Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs(changelog): defer release entries to final backlog PR Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: TheWitness <thewitness@cacti.net>
This commit is contained in:
1 parent
71f2d55b6a
commit
72ddd59cdc
2 files changed
+4
-2
No files matched your search
@@ -580,7 +580,8 @@ function automation_graph_rules_item_edit() : void {
|
||||
gfrv('rule_type');
|
||||
// ====================================================
|
||||
|
||||
global_item_edit(grv('id'), grv('item_id'), grv('rule_type'));
|
||||
// Numeric validation preserves an empty ID when creating a new item.
|
||||
global_item_edit(grv('id'), (int) grv('item_id'), grv('rule_type'));
|
||||
|
||||
form_hidden_box('rule_type', grv('rule_type'), grv('rule_type'));
|
||||
form_hidden_box('id', (isrv('id') ? grv('id') : '0'), '');
|
||||
|
||||
@@ -627,7 +627,8 @@ function automation_tree_rules_item_edit() : void {
|
||||
}
|
||||
|
||||
if (!isrv('tab') || grv('tab') == 'rule') {
|
||||
global_item_edit(grv('id'), grv('item_id'), grv('rule_type'));
|
||||
// Numeric validation preserves an empty ID when creating a new item.
|
||||
global_item_edit(grv('id'), (int) grv('item_id'), grv('rule_type'));
|
||||
|
||||
form_hidden_box('rule_type', grv('rule_type'), grv('rule_type'));
|
||||
form_hidden_box('id', (isrv('id') ? grv('id') : '0'), '');
|
||||
|
||||
Reference in new issue
Block a user