mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
TFTP Service v1.0.9 (#1905)
Fixed bug in app_defaults that recreated new setting eacg upgrade
This commit is contained in:
@@ -60,22 +60,21 @@
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//find the missing default settings
|
||||
$x = 0;
|
||||
$missing = [];
|
||||
foreach ($array as $setting) {
|
||||
$found = false;
|
||||
$missing[$x] = $setting;
|
||||
foreach ($default_settings as $row) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||
$found = true;
|
||||
//remove items from the array that were found
|
||||
unset($missing[$x]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$x++;
|
||||
|
||||
if (!$found) $missing[] = $setting;
|
||||
}
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
|
||||
Reference in New Issue
Block a user