From b30ee72ac6f66f53e882f3b2b53234debf479f87 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 28 Jun 2016 18:02:11 -0500 Subject: [PATCH] Restore code previous to part of previous commit to avoid notice --- main/inc/lib/api.lib.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index bca73a5832..b16b8c2696 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -5247,11 +5247,8 @@ function & api_get_settings($cat = null, $ordering = 'list', $access_url = 1, $u $sql .= " ORDER BY 1,2 ASC"; } $result = Database::query($sql); - if ($result == false) { - return array(); - } else { - return Database::store_result($result); - } + $result = Database::store_result($result,'ASSOC'); + return $result; } /** @@ -5268,12 +5265,8 @@ function & api_get_settings_categories($exceptions = array(), $access_url = 1) { if ($list != "'',''" && $list != "''" && !empty($list)) { $sql .= " AND category NOT IN ($list) "; } - $result = Database::query($sql); - if ($result == false) { - return array(); - } else { - return Database::store_result($result); - } + $result = Database::store_result(Database::query($sql)); + return $result; } /**