Closed (fixed)
Project:
Simplenews
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2008 at 04:37 UTC
Updated:
11 Sep 2008 at 05:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
coltraneBlocking the account works correctly, the a_status column of their simplenews_subscriptions record is changed to 0 but delete doesn't work correctly. The _simplenews_user_load() in simplenews_get_user_subscription() during the delete op of simplenews_user() is returning an account with uid 0 which keeps the delete sql from affecting the correct rows.
Comment #2
coltraneVerified this in latest 5 branch.
From simplenews_user():
The DELETE FROM table simplenews_subscriptions could be altered to use account->uid but there needs to be a way to delete the record in table simplenews_snid_tid. First a select of it from simplenews_subscriptions would work ... but I think this needs feedback before I roll a patch.
Comment #3
sutharsan commentedThe attached patch should solve this problem.
When deleting a user user_load() can not be used anymore and simplenews_get_user_subscription() requires this function to get the subcriber's snid.
Comment #4
coltraneYes, the patch fixes the problem, thank you very much!
One small thing, though the select sql works I think its proper to use the table alias on the columns being selected. If this select ever became a join it would fail.
should be
Here's your patch rerolled with it.
Comment #5
sutharsan commentedThanks. Patch committed.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.