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:
Thomas VincentandTheWitness authored and GitHub committed 2026-10-11 21:14:26 -04:00
1 parent 71f2d55b6a
commit 72ddd59cdc
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -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'), '');
+2 -1
View File
@@ -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'), '');