From cfe88f890119dcb1a509e5692326a1f1f92f3e9c Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 14 Jan 2023 10:12:03 +0100 Subject: [PATCH] Fix the condition check of the "get_setting" method of providers, secretaries and admins (#1327) --- application/models/Admins_model.php | 2 +- application/models/Providers_model.php | 2 +- application/models/Secretaries_model.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Admins_model.php b/application/models/Admins_model.php index 5408a039..8d2813fa 100644 --- a/application/models/Admins_model.php +++ b/application/models/Admins_model.php @@ -496,7 +496,7 @@ class Admins_model extends EA_Model { { $settings = $this->db->get_where('user_settings', ['id_users' => $admin_id])->row_array(); - if (empty($settings)) + if ( ! array_key_exists($name, $settings)) { throw new RuntimeException('The requested setting value was not found: ' . $admin_id); } diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 6b2777d3..21442dc4 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -541,7 +541,7 @@ class Providers_model extends EA_Model { { $settings = $this->db->get_where('user_settings', ['id_users' => $provider_id])->row_array(); - if (empty($settings[$name])) + if ( ! array_key_exists($name, $settings)) { throw new RuntimeException('The requested setting value was not found: ' . $provider_id); } diff --git a/application/models/Secretaries_model.php b/application/models/Secretaries_model.php index 741908d5..5a562c2d 100644 --- a/application/models/Secretaries_model.php +++ b/application/models/Secretaries_model.php @@ -518,7 +518,7 @@ class Secretaries_model extends EA_Model { { $settings = $this->db->get_where('user_settings', ['id_users' => $secretary_id])->row_array(); - if (empty($settings[$name])) + if ( ! array_key_exists($name, $settings)) { throw new RuntimeException('The requested setting value was not found: ' . $secretary_id); }