The website's broken after the module update!

Created on 14 July 2022, almost 2 years ago
Updated 1 December 2023, 7 months ago

Problem/Motivation

The website's broken after the module update!

HOTFIX 1
Simply uninstall the module and install the last version.

Pros: Fast&Easy
Cons: The module needs to be reconfigured by hand or by the configuration export/import feature.

HOTFIX 2
Download this issue fork code base and upload it to your server.
Than run /update.php script to apply changes.

Pros: Keeps the module configuration.

Steps to reproduce

Install v2.0.1

composer require 'drupal/watchdog_mailer:2.0.1'

Update v2.0.1

composer require 'drupal/watchdog_mailer:^2.0'

Go to /admin/config/development/logging

The white screen with 'The website encountered an unexpected error. Please try again later.' message.

Proposed resolution

v2.0.3 release introduced the new feature Add maximum emails per hour β†’ .
The database table watchdog_mailer_history was added. It stores the log unique ID and the timestamp.
The schema is defined in watchdog_mailer.install file.

The problem is that the table is currently created on the module install only!

We need to implement hook_update_N() (used for updating the module's database schema) to keep the backward compatibility.
The hook will create the new database table from the schema defined by the module.
Users who updates the module from previous version will get the notice to run /update.php script to apply the updated database schema.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

Updates the database schema.
Adds the new table ('watchdog_mailer_history') with fields ('wmid', 'timestamp').

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡ΏCzech Republic D4K0 Prague

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

Merge Requests

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.69.0 2024