Problem/Motivation

When you run cron you should see the following error:

Warning: Trying to access array offset on value of type null in Drupal\Core\Cron->processQueue() (line 264 of /var/www/html/core/lib/Drupal/Core/Cron.php)

Steps to reproduce

Run cron.

Proposed resolution

  1. Take into account that the parent class has a constructor.
  2. Since the class code of both plugins is completely the same, create a base class for them.
  3. Ensure that the user entity is found based on E-mail and that the user entity isn't a pre-defined entity created during the enabling installation profile.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lexhouk created an issue. See original summary.

ohorbatiuk’s picture

Assigned: ohorbatiuk » Unassigned
Status: Active » Needs review
StatusFileSize
new4.87 KB
ohorbatiuk’s picture

Issue summary: View changes
StatusFileSize
new7.95 KB
new3.83 KB

Ensure that the user entity is found based on E-mail and that the user entity isn't a pre-defined entity created during the enabling installation profile.

ohorbatiuk’s picture

StatusFileSize
new8.64 KB
new706 bytes

Add checking to exist a severity record during letter content creation.

ohorbatiuk’s picture

StatusFileSize
new8.64 KB
new741 bytes

Fix the condition that was added in the previous patch.

szato’s picture

Version: 4.0.0 » 4.0.x-dev
Status: Needs review » Needs work
Related issues: +#3405521: Undefined array key "severity" in exception_mailer_mail()

@lexhouk,

thank you for your report, and work.

We should update the patch:

szato’s picture

We also want to send emails to addresses that aren't associated with existing users, so we need something like this:

  $data['email'] = $admin;
  if ($user = user_load_by_mail($admin)) {
    $data['user_langcode'] = $user->getPreferredLangcode();
  }
  $queue->createItem($data);
}
szato’s picture

szato’s picture

Status: Needs work » Needs review

Regarding points: 1, 2
I removed 'exception_email_queue' plugin, we are using only the 'manual_exception_email'. Duplicates were made in the commit: https://git.drupalcode.org/project/exception_mailer/-/commit/31379083fbc...

MR created.

Kosa Ilma made their first commit to this issue’s fork.

kosa ilma’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.