From 60db1ac8333303a6fcd29cc4278b5501b3778b17 Mon Sep 17 00:00:00 2001 From: OsaAjani Date: Mon, 23 May 2016 19:18:05 +0200 Subject: [PATCH] Fix groups et contacts par api --- controllers/smsAPI.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/smsAPI.php b/controllers/smsAPI.php index 1c3b05d..ea0288f 100755 --- a/controllers/smsAPI.php +++ b/controllers/smsAPI.php @@ -79,6 +79,7 @@ unset($contacts[$key]); continue; } + $contact = $contact[0]; $contacts[$key] = $contact['id']; } @@ -86,11 +87,12 @@ //Pour chaque groupe, on récupère l'id du groupe foreach ($groups as $key => $name) { - if ($group = $db->getFromTableWhere('groups', ['name' => $name])) + if (!$group = $db->getFromTableWhere('groups', ['name' => $name])) { unset($groups[$key]); continue; } + $group = $group[0]; $groups[$key] = $group['id']; }