CRM-16943: CRM_Core_Form_Search assumes a checkbox. CiviGrant dashboard has none
authoryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 7 Aug 2015 10:58:20 +0000 (16:28 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 7 Aug 2015 10:58:20 +0000 (16:28 +0530)
----------------------------------------
* CRM-16943: CRM_Core_Form_Search assumes a checkbox. CiviGrant dashboard has none
  https://issues.civicrm.org/jira/browse/CRM-16943

CRM/Core/Form/Search.php

index 1d5cb5798c107dcc9f04e7ac059d2e6a5d3ecdc0..466844bbc768ba909389ae851ade2ee67f3d66fa 100644 (file)
@@ -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'));
+      }
     }
   }