Merge pull request #12424 from alifrumin/editOwnEvents
[civicrm-core.git] / CRM / Pledge / Selector / Search.php
index c20f9a178eff28643b249bd1e9ac9275fbb5a578..c862e4e59e6433c5997b74d6e037e903d30e33d0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
@@ -319,9 +319,11 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
       $row['campaign_id'] = $result->pledge_campaign_id;
 
       // add pledge status name
-      $row['pledge_status_name'] = CRM_Utils_Array::value($row['pledge_status_id'],
-        $pledgeStatuses
-      );
+      if (!empty($row['pledge_status_id'])) {
+        $row['pledge_status_name'] = CRM_Utils_Array::value($row['pledge_status_id'],
+          $pledgeStatuses
+        );
+      }
       // append (test) to status label
       if (!empty($row['pledge_is_test'])) {
         $row['pledge_status'] .= ' (test)';