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.
This commit is contained in:
FusionPBX 2024-10-23 15:10:31 -06:00 committed by GitHub
parent adf3ac9aab
commit 11cc01a79a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 0 deletions

View File

@ -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);
}
?>