From 11cc01a79aeba502d5abd3a7ed405d20fc104ae8 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 23 Oct 2024 15:10:31 -0600 Subject: [PATCH] Provision settings adjust types If the type is boolean with a value of 0 or 1, use type text; if it is numeric, use type text. The template default setting uses a string for the template values, and a boolean type is used with conditions. --- app/provision/app_defaults.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/provision/app_defaults.php b/app/provision/app_defaults.php index bef8f0b3c8..ad2ff01dde 100644 --- a/app/provision/app_defaults.php +++ b/app/provision/app_defaults.php @@ -118,6 +118,23 @@ if ($domains_processed == 1) { $sql .= "and domain_setting_name = 'text' "; $database->execute($sql); + //update if the type is boolean with value of 0 or 1 use type text, or if type numeric use type text. + //explanation: the template default setting use string for the template values, boolean type only used with conditions + $sql = "update v_default_settings "; + $sql .= "set default_setting_name = 'text' "; + $sql .= "where "; + $sql .= "( "; + $sql .= " default_setting_category = 'provision' "; + $sql .= " and default_setting_value in ('0', '1') "; + $sql .= " and default_setting_name = 'boolean' "; + $sql .= ") "; + $sql .= "or "; + $sql .= "( "; + $sql .= "default_setting_category = 'provision' "; + $sql .= "and default_setting_name = 'numeric' "; + $sql .= ") "; + $database->execute($sql); + } ?>