From: yashodha Date: Fri, 7 Aug 2015 10:58:20 +0000 (+0530) Subject: CRM-16943: CRM_Core_Form_Search assumes a checkbox. CiviGrant dashboard has none X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4126499f162da45490f060d4c10cfd4bc66f7e2e;p=civicrm-core.git CRM-16943: CRM_Core_Form_Search assumes a checkbox. CiviGrant dashboard has none ---------------------------------------- * CRM-16943: CRM_Core_Form_Search assumes a checkbox. CiviGrant dashboard has none https://issues.civicrm.org/jira/browse/CRM-16943 --- diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 1d5cb5798c..466844bbc7 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -120,8 +120,10 @@ class CRM_Core_Form_Search extends CRM_Core_Form { */ public function addRowSelectors($rows) { $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows')); - foreach ($rows as $row) { - $this->addElement('checkbox', $row['checkbox'], NULL, NULL, array('class' => 'select-row')); + if (!empty($rows)) { + foreach ($rows as $row) { + $this->addElement('checkbox', $row['checkbox'], NULL, NULL, array('class' => 'select-row')); + } } }