Update hook 840002 fails with SQL error

Created on 25 October 2023, about 1 year ago
Updated 13 December 2023, about 1 year ago

Problem/Motivation

The update hook simplenews_update_840002 fails with an SQL error, if the current project does not contain a subscriber without a subscription.
Query condition 'id NOT IN ()' cannot be empty.

Steps to reproduce

* Setup Drupal 9 project
* Install simplenews:^3
* Configure simplenews
* Do not add a subscriber without a subscription
* Update to simplenews:^4
* Run update hooks

Proposed resolution

* Use provided patch, whichs adds a condition in the affected update hook to not execute the causing SQL query if no results are available. I will add the patch in the first comment.

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇩🇪Germany jocowood Kamp-Lintfort

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

Comments & Activities

Production build 0.71.5 2024