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.
Comment | File | Size | Author |
---|---|---|---|
#2 | Issue_#3396668_Adds_safety_condition_to_database_query_for_update_hook_840002.patch | 1.05 KB | JoCowood |
Issue fork simplenews-3396668
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:
Comments
Comment #2
JoCowoodComment #3
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedThanks 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.
Comment #5
JoCowoodMR created
Comment #6
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedThanks. I'll commit this once the branch tests are working so we can get a pass here.
Comment #8
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedComment #10
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedFYI there's still a bug: #3405456: Update fails if there are no newsletters with subscriptions
Comment #11
JoCowoodThank you for the hint AdamPS