Update 20005 fails when mailer_policy is not enabled.

Created on 8 August 2025, 27 days ago

Problem/Motivation

Update 20005 fails when mailer_policy is not enabled.

Steps to reproduce

  • Ensure mailer_policy is not enabled.
  • Try to run drush updb or update.php
  • Run into the following error;

Error Output:
================
> [notice] Update started: symfony_mailer_update_20005
> [error] Class "Drupal\mailer_policy\Entity\MailerPolicy" not found
> [error] Update failed: symfony_mailer_update_20005
[error] Update aborted by: symfony_mailer_update_20005
[error] Finished performing updates.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada AaronChristian Kelowna, BC

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

Comments & Activities

  • Issue created by @AaronChristian
  • 🇨🇦Canada AaronChristian Kelowna, BC
  • 🇬🇧United Kingdom adamps

    Thanks. It's a fairly unusual case because symfony_mailer_update_20001() enabled the mailer_policy module on all sites. However it's a valid bug. Presumably the same problem exists with symfony_mailer_update_20004().

    The solution should be easy - just add

    if (\Drupal::service('module_handler')->moduleExists('mailer_policy'))
    
Production build 0.71.5 2024