Module doesn't delete records into schedulers tables when u delete a node.
Than when u delete some scheduled newsletter, simplenews_scheduler tries to send it the same duplicating non-existent node.
Maybe a solution it could be insert into the hook_nodeapi
case 'delete':
db_query('DELETE FROM {simplenews_scheduler} WHERE nid = %d', $node->nid);
db_query('DELETE FROM {simplenews_scheduler_editions} WHERE eid = %d', $node->nid);
break;
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 934940-simplenews_scheduler-delete-editions.patch | 452 bytes | muschpusch |
| #9 | simplenews_scheduler-delete-editions.patch | 452 bytes | repeater |
Comments
Comment #1
sgabe commentedThank you, that's correct, but there is a question related to node deletion. If a parent newsletter is deleted, should be it's editions be deleted also?
Comment #2
Rizhaya commentedMaybe, it should be like an option at the node settings?
Also I think that {simplenews_scheduler_editions} should be cleaned up when you delete editions at least.
Comment #3
pheudo commentedOr a confirm option during node delete...
Comment #4
Sepero commentedWhile using the beta3 release, I was getting this error after deleting a newsletter that was currently scheduled to be sent.
On running cron
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/learnope/public_html/sites/all/modules/rules/rules/modules/php.rules.inc(107) : eval()'d code on line 2.
I installed the dev release, ran cron, and the issue appears to be resolved. thx
Comment #5
sgabe commented#1226304: Create empty nodes even the original simplenews node been deleted. is marked as a duplicate of this.
Comment #6
dgtlmoon commentedComitted to 1.x and 2.x dev branches, I have not chosen to automatically delete the references to the generated simplenews scheduler nodes, or those nodes themselves, incase the administrator wants that data or wants to keep those newsletters.
Comment #7
dgtlmoon commentedtested by community and rolled into latest release
Comment #9
repeater commentedHere's a patch for people who want to get ride of newsletter edition record on database when the newsletter edition node is erased.
Comment #10
joachim commentedShould this be reopened? Or should the patch be moved to new issue?
Comment #11
muschpusch commented#9 patch works fine but git complained so rerolling. Please commit this since it's pretty basic and fixing a major bug...
Comment #12
dgtlmoon commentedGreat, comitted