When the toggle field and values are empty then use defaults

This commit is contained in:
FusionPBX 2023-08-15 21:37:05 -06:00 committed by GitHub
parent 18df561513
commit 4ed611a187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -1983,6 +1983,15 @@
}
}
//if the toggle field and values are empty then set defaults
if (empty($toggle_field)) {
$toggle_field = self::singular($parent_name)."_enabled";
}
if (empty($toggle_values)) {
$toggle_values[] = 'true';
$toggle_values[] = 'false';
}
//get the current values from the database
foreach ($toggle_array as $table_name => $table) {
$x = 0;