array is expected
authordemeritcowboy <demeritcowboy@hotmail.com>
Sun, 3 Oct 2021 22:37:45 +0000 (18:37 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Mon, 4 Oct 2021 18:30:27 +0000 (14:30 -0400)
CRM/Contact/Form/Task/EmailTrait.php
tests/phpunit/CRM/Core/FormTest.php

index dd5bef8ca6b67b3c0d5733d54589dba58574b60c..82c136ebbc9c3025cb7052d07a307a631c9d7b63 100644 (file)
@@ -148,6 +148,11 @@ trait CRM_Contact_Form_Task_EmailTrait {
     if ($cid) {
       $this->_contactIds = explode(',', $cid);
     }
+    // The default in CRM_Core_Form_Task is null, but changing it there gives
+    // errors later.
+    if (is_null($this->_contactIds)) {
+      $this->_contactIds = [];
+    }
     if (count($this->_contactIds) > 1) {
       $this->_single = FALSE;
     }
index 0041d19ac39be487b4104f2b757fdba25fe3913f..2f6d3f4599fca79f77918c34f1e6af5c2b6f803c 100644 (file)
@@ -28,6 +28,10 @@ class CRM_Core_FormTest extends CiviUnitTestCase {
       $_REQUEST[$param] = $value;
     }
 
+    require_once 'HTML/QuickForm.php';
+    $form = new HTML_QuickForm();
+    $form->registerRule('maxfilesize', 'callback', '_ruleCheckMaxFileSize', 'HTML_QuickForm_file');
+
     $item = CRM_Core_Invoke::getItem([$_GET['q']]);
     ob_start();
     CRM_Core_Invoke::runItem($item);
@@ -59,6 +63,9 @@ class CRM_Core_FormTest extends CiviUnitTestCase {
       'Fulltext search' => [
         'civicrm/contact/search/custom?csid=15&reset=1',
       ],
+      'New Email' => [
+        'civicrm/activity/email/add?atype=3&action=add&reset=1&context=standalone',
+      ],
     ];
   }