Check the missing array has content before processing it.
This commit is contained in:
parent
7aa61e2d53
commit
3abaff004c
|
|
@ -70,7 +70,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
|
||||
//add the missing default settings
|
||||
foreach ($missing as $row) {
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ if ($domains_processed == 1) {
|
|||
$array[$x]['default_setting_enabled'] = 'true';
|
||||
$array[$x]['default_setting_description'] = 'Delay before next call sequence';
|
||||
$x++;
|
||||
|
||||
//get an array of the default settings
|
||||
$sql = "select * from v_default_settings ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
|
|
@ -160,7 +161,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
|
||||
//add the missing default settings
|
||||
foreach ($missing as $row) {
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@
|
|||
}
|
||||
|
||||
//add the missing default settings
|
||||
foreach ($missing as $row) {
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
|
||||
//add the missing default settings
|
||||
foreach ($missing as $row) {
|
||||
if (count($missing) > 0) foreach ($missing as $row) {
|
||||
//add the default settings
|
||||
$orm = new orm;
|
||||
$orm->name('default_settings');
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ EOD;
|
|||
function set_country_vars($db, $x) {
|
||||
require "resources/countries.php";
|
||||
|
||||
// $country_iso=$_SESSION['domain']['country']['iso_code'];
|
||||
//$country_iso=$_SESSION['domain']['country']['iso_code'];
|
||||
|
||||
$sql = "select default_setting_value as value from v_default_settings ";
|
||||
$sql .= "where default_setting_name = 'iso_code' ";
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
|
||||
$x = 0;
|
||||
foreach ($array as $row) {
|
||||
if (isset($array)) foreach ($array as $row) {
|
||||
$found = false;
|
||||
foreach ($default_settings as $field) {
|
||||
if ($row['default_setting_subcategory'] == $field['default_setting_subcategory']) {
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ if ($domains_processed == 1) {
|
|||
$missing_count = $i;
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) {
|
||||
$sql = "insert into v_default_settings (";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
|
|
@ -357,6 +358,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
$db->exec(check_sql($sql));
|
||||
unset($missing);
|
||||
}
|
||||
|
||||
//move the dynamic provision variables that from v_vars table to v_default_settings
|
||||
if (count($_SESSION['provision']) == 0) {
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ if (!class_exists('switch_settings')) {
|
|||
}
|
||||
|
||||
//add the missing default settings
|
||||
if (is_array($missing)) {
|
||||
if (count($missing) > 0) {
|
||||
$sql = "insert into v_default_settings (";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
|
|
|
|||
|
|
@ -1346,6 +1346,7 @@ if ($domains_processed == 1) {
|
|||
$missing_count = $i;
|
||||
|
||||
//add the missing default settings
|
||||
if (count($missing) > 0) {
|
||||
$sql = "insert into v_default_settings (";
|
||||
$sql .= "default_setting_uuid, ";
|
||||
$sql .= "default_setting_category, ";
|
||||
|
|
@ -1373,6 +1374,7 @@ if ($domains_processed == 1) {
|
|||
}
|
||||
$db->exec(check_sql($sql));
|
||||
unset($missing);
|
||||
}
|
||||
|
||||
//unset the array variable
|
||||
unset($array);
|
||||
|
|
|
|||
Loading…
Reference in New Issue