Notice if no prev. mailing reports exist in a system (#11181)
authoryurg <yurg@users.noreply.github.com>
Tue, 24 Oct 2017 20:56:39 +0000 (22:56 +0200)
committerEileen McNaughton <eileen@mcnaughty.com>
Tue, 24 Oct 2017 20:56:39 +0000 (07:56 +1100)
*  Notice if no prev. mailing reports exist in a system

https://civicrm.stackexchange.com/questions/20943/blank-page-in-mailings-with-notice/

* Update Info.php

Spaces according to code style and https://test.civicrm.org/job/CiviCRM-Core-PR/17741/checkstyleResult/new/

* Update Info.php

White spaces correction

CRM/Mailing/Info.php

index 59ec9e123549e84fb5433cb9ef6a68fb6a6f8f98..50e3f07bbf5d1c90e9ede3dd3aca122d10eb2c60 100644 (file)
@@ -79,7 +79,9 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
       $result = civicrm_api3('ReportInstance', 'get', array(
         'sequential' => 1,
         'report_id' => 'mailing/' . $report));
-      $reportIds[$report] = $result['values'][0]['id'];
+      if (!empty($result['values'])) {
+        $reportIds[$report] = $result['values'][0]['id'];
+      }
     }
     $result = array();
     $result['crmMailing'] = include "$civicrm_root/ang/crmMailing.ang.php";