TFTP Service v1.0.9 (#1905)

Fixed bug in app_defaults that recreated new setting eacg upgrade
This commit is contained in:
minotaur01
2016-09-08 23:28:26 -04:00
committed by FusionPBX
parent fa0ac3f46b
commit a2992782e3

View File

@@ -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');