Reroute Email unsets message params in hook_mail_alter

Created on 11 January 2022, almost 3 years ago
Updated 28 September 2023, about 1 year ago

Problem/Motivation

The following code removes the 'params' array key, which is supposed to be always existing according to hook_mail_alter documentation:

// Extensive params keys cause OOM error in var_export().
unset($message['params']);

Gitlab line: https://git.drupalcode.org/project/reroute_email/-/blob/2.x/reroute_emai...

#3255718: Notice: Undefined index: params in Drupal\mailgun\Plugin\Mail\MailgunMail β†’ is a minor side effect, but it can be introduced by any custom module, so we'll have to be defensive there.
However, we can still do a good thing and preserve the array key to match the hook documentation.

Steps to reproduce

Use Reroute Email + Mailgun (8.x-1.0).

Proposed resolution

Preserve 'params' array key, but make it empty for the reason mentioned in the comment.

Remaining tasks

Review, commit.

πŸ› Bug report
Status

Closed: duplicate

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Matroskeen πŸ‡ΊπŸ‡¦ Ukraine, Lutsk

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024