Check the missing array has content before processing it.

This commit is contained in:
markjcrane
2016-05-04 00:22:35 -06:00
parent 37e46ed2c9
commit 097a5d8ade
10 changed files with 63 additions and 58 deletions

View File

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

View File

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

View File

@@ -39,7 +39,7 @@ if ($domains_processed == 1) {
//iterate and add each, if necessary
foreach ($array as $index => $default_settings) {
//add default settings
//add default settings
$sql = "select count(*) as num_rows from v_default_settings ";
$sql .= "where default_setting_category = '".$default_settings['default_setting_category']."' ";
$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";

View File

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

View File

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

View File

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

View File

@@ -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']) {