Skip to content

Commit

Permalink
QA: #5583 - Missed on file - adding more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Nov 24, 2023
1 parent 2342b4a commit 482372b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/global_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
'friendly_name' => __('Template'),
'description' => __('The default Device Template used on all new Devices.'),
'method' => 'drop_sql',
'default' => '1',
'default' => '',
'none_value' => __('None'),
'sql' => 'SELECT id, name FROM host_template ORDER BY name',
),
Expand Down
7 changes: 5 additions & 2 deletions lib/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2986,9 +2986,10 @@ private function install() {
}

private function setDefaultTemplate() {
if (read_config_option('default_template', true) == '') {
$default_set = false;
$default_template = read_config_option('default_template');
log_install_always('', __('Current Default Device Template is \'%s\'', $default_template));

if (empty(read_config_option('default_template', true))) {
foreach($this->defaultAutomation as $item) {
$host_template_id = db_fetch_cell_prepared('SELECT id
FROM host_template
Expand All @@ -3001,6 +3002,8 @@ private function setDefaultTemplate() {
set_config_option('default_template', $host_template_id);

break;
} else {
log_install_always('', __('Unable to find Device Template to \'%s\'', $item['name']));
}
}
}
Expand Down

0 comments on commit 482372b

Please sign in to comment.