Fix string parameter being passed non string variable
author19ATF72 <micah.hobby@gmail.com>
Tue, 5 Dec 2023 11:53:10 +0000 (03:53 -0800)
committer19ATF72 <micah.hobby@gmail.com>
Tue, 5 Dec 2023 12:04:18 +0000 (04:04 -0800)
CRM/Mailing/BAO/MailingComponent.php
ext/civi_mail/Civi/Api4/MailingComponent.php

index f015b5cb91774815327111e130ff741b28b3fdad..cc5212f44ecb943ca9b2c76cce36a34e938c7ccc 100644 (file)
@@ -58,7 +58,7 @@ class CRM_Mailing_BAO_MailingComponent extends CRM_Mailing_DAO_MailingComponent
 
     $component->copyValues($params);
     if (empty($id) && empty($params['body_text'])) {
-      $component->body_text = CRM_Utils_String::htmlToText(CRM_Utils_Array::value('body_html', $params));
+      $component->body_text = CRM_Utils_String::htmlToText($params['body_html'] ?? '');
     }
 
     if ($component->is_default) {
index 62d0d3fcd9f93dd63e1daf2fd156855888b46a21..5aec1c4ae332353dbf87725d253f5b5a816169f2 100644 (file)
@@ -12,7 +12,7 @@ namespace Civi\Api4;
 
 /**
  * MailingComponent
- * 
+ *
  * @searchable secondary
  * @since 5.70
  * @package Civi\Api4