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.

Issue fork simplenews-3396668

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JoCowood created an issue. See original summary.

JoCowood’s picture

AdamPS’s picture

Status: Needs review » Needs work

Thanks it looks good. Please create a MR, this project now uses gitlab testing.

Unfortunately commit would need to wait until someone can figure out how to fix the tests, see #3395901: Use Gitlab CI in Simplenews.

JoCowood’s picture

Status: Needs work » Needs review

MR created

AdamPS’s picture

Status: Needs review » Reviewed & tested by the community

Thanks. I'll commit this once the branch tests are working so we can get a pass here.

  • AdamPS committed b0a7f4a1 on 4.x authored by JoCowood
    Issue #3396668 by JoCowood: Update hook 840002 fails with SQL error
    
AdamPS’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

AdamPS’s picture

JoCowood’s picture

Thank you for the hint AdamPS