Update Status mailer policy broken by core hooks modernization

Created on 11 July 2025, 10 days ago

Problem/Motivation

Update Status policy crashes in Drupal 11 due to missing update_requirements().

Error: Call to undefined function Drupal\symfony_mailer\Plugin\EmailBuilder\update_requirements() in .../modules/contrib/symfony_mailer/src/Plugin/EmailBuilder/UpdateEmailBuilder.php on line 64 #0 [internal function]: Drupal\symfony_mailer\Plugin\EmailBuilder\UpdateEmailBuilder->build()

(This location is from 1.6.x release but 2.x/src/Plugin/Mailer/UpdateMailer.php is also affected.)

Issue πŸ“Œ Convert hook requirements that do not interact with install time Active removed hooks from update.install, including update_requirements(), and replaced them with Drupal\update\Hook\UpdateRequirements. These calls will need to be replaced in the mailer policies.

Steps to reproduce

Install Drupal 11.2.0 or higher and enable the Update Status mailer policy. Drupal will crash when attempting to send a status email message.

I'm reluctant to elevate priority on this, but this has been causing cron runs to crash in my production environment.

Proposed resolution

This bug can be mitigated by disabling the Update Status policy and letting Drupal core generate the email message text.

Calls to update_requirements() will need to be replaced with calls to (I think) UpdateRequirements::runtime(), but I am not sure that the new autowired hook services can be injected as dependencies, so I currently have no recommendations about how to make this work.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Policy

Created by

πŸ‡ΊπŸ‡ΈUnited States micahw156

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

Comments & Activities

Production build 0.71.5 2024