From: Jagadedes Date: Wed, 19 Nov 2014 08:50:30 +0000 (+0530) Subject: first time created widget warning fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6ca246e99dee84a0b425d35ded32b3c6894c926d;p=com.zyxware.civiwci.git first time created widget warning fix --- diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index e0b3579..1194d07 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -387,13 +387,13 @@ where w.id=" . $this->_id;*/ ); $result = civicrm_api3('group', 'get', array( - 'group_type' => '2' + 'group_type' => '2' // group type of newsletter(2) )); - - foreach ($result['values'] as $group) { - $options[$group['id']] = $group['title']; - } - + if (0 != $result['count']) { + foreach ($result['values'] as $group) { + $options[$group['id']] = $group['title']; + } + } return $options; }