Skip to content

Commit

Permalink
Fixing Issue #4654 data template save warnings (#4655)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Mar 29, 2022
1 parent 2cf0848 commit 870eee2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -98,6 +98,7 @@ Cacti CHANGELOG
-issue#4645: If you attempt to use a format file for a non-existant setting Cacti throws warnings
-issue#4651: Device Description is not consistent in Poller Cache view
-issue#4652: After repopulating graph, navigation to check cumbersome
-issue#4654: function push_out_host() throws errors when saving a data template
-feature: Expose hidden Language Translation setting l10n_language_handler
-feature: Allow a Device to be a part of a Report outside of a Tree
-feature: Allow Basic Authentication to display customer login failed message
Expand Down
16 changes: 15 additions & 1 deletion data_templates.php
Expand Up @@ -291,7 +291,21 @@ function form_save() {

/* push out all "custom data" for this data source template */
push_out_data_source_custom_data($data_template_id);
push_out_host(0, 0, $data_template_id);

/* push out the hosts that use the data template */
$hosts = array_rekey(
db_fetch_assoc_prepared('SELECT host_id
FROM data_local
WHERE data_template_id = ?',
array($data_template_id)),
'host_id', 'host_id'
);

if (cacti_sizeof($hosts)) {
foreach($hosts as $host_id) {
push_out_host($host_id, 0, $data_template_id);
}
}

/* push out field mappings for the data collector */
/* its important to delete first due to the possibility that
Expand Down

0 comments on commit 870eee2

Please sign in to comment.