Contact module recipent field raising issue on ajax fields for Module contact_mail_formatter

Created on 3 June 2024, 9 months ago

Problem/Motivation

Steps to reproduce

Module: https://www.drupal.org/project/contact_mail_formatter
Code branch: https://git.drupalcode.org/project/contact_mail_formatter/-/tree/mailer_...

TypeError: implode(): Argument #1 ($array) must be of type array, string given in implode() (line 96 of /app/web/core/modules/contact/src/ContactFormEditForm.php).

$form['recipients'] = [
      '#type' => 'textarea',
      '#title' => $this->t('Recipients'),
      '#default_value' => implode(', ', $contact_form->getRecipients()),
      '#description' => $this->t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com' . To specify multiple recipients, separate each email address with a comma."),
      '#required' => TRUE,
    ];

Proposed resolution

'#default_value' => implode(', ', $contact_form->getRecipients()),

needs to be changed

'#default_value' => (is_array($contact_form->getRecipients()))? implode(', ', $contact_form->getRecipients()) : $contact_form->getRecipients(),
🐛 Bug report
Status

Active

Version

10.4

Component
Contact 

Last updated 17 days ago

Created by

🇮🇳India jitendra verma Delhi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024