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;
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sgabe’s picture

Thank 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?

Rizhaya’s picture

Maybe, 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.

pheudo’s picture

Or a confirm option during node delete...

Sepero’s picture

While 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

sgabe’s picture

dgtlmoon’s picture

Status: Active » Needs review

Comitted 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.

dgtlmoon’s picture

Status: Needs review » Fixed

tested by community and rolled into latest release

Status: Fixed » Closed (fixed)

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

repeater’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
FileSize
452 bytes

Here's a patch for people who want to get ride of newsletter edition record on database when the newsletter edition node is erased.

joachim’s picture

Should this be reopened? Or should the patch be moved to new issue?

muschpusch’s picture

Status: Closed (fixed) » Reviewed & tested by the community
FileSize
452 bytes

#9 patch works fine but git complained so rerolling. Please commit this since it's pretty basic and fixing a major bug...

dgtlmoon’s picture

Status: Reviewed & tested by the community » Fixed

Great, comitted

Status: Fixed » Closed (fixed)

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