Entity storage exception during module install missing @message parameter in Error::logException() call.

Created on 18 August 2023, 10 months ago
Updated 3 March 2024, 4 months ago

Problem/Motivation

If there is an entity storage exception thrown during module install, the Error::logException() is missing a replacement for the @message placeholder, so the exception message is not shown or logged.

Steps to reproduce

Using Drush, after the Drupal Core upgrade from 9.5.x to 10.1.2 and running drush deploy command

Note error messages:

>

 >  [notice] Update started: system_post_update_enable_password_compatibility                                                                                                                                                      
  >  [error]  The module hal does not exist.                                                                                                                                                                                       
  >  [error]  Update failed: system_post_update_enable_password_compatibility                                                                                                                                                                                                                                                                                                                                                                            
  >  [warning] Invalid placeholder (severity_level) with string: "%type: @message in %function (line %line of %file)." FormattableMarkup.php:245                                                                                    
  >  [warning] Invalid placeholder (exception) with string: "%type: @message in %function (line %line of %file)." FormattableMarkup.php:245                                                                                         
   [error]  Update aborted by: system_post_update_enable_password_compatibility                                                                                                                                                     
   [error]  Finished performing updates.                               

Proposed resolution

Set exception message $e->getMessage() as a replacement for @message placeholder.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
ExtensionΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡¦Ukraine ysamoylenko

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024