Skip to content

Commit

Permalink
Merge pull request #21 from argiepiano/1.x-1.x-issue-20
Browse files Browse the repository at this point in the history
Issue #20. Clear node entity cache after sending.
  • Loading branch information
alanmels committed Mar 20, 2023
2 parents a827450 + 437de22 commit 778473c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/simplenews.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2070,4 +2070,7 @@ function simplenews_node_tab_send_form_submit($form, &$form_state) {
simplenews_newsletter_save($newsletter);
backdrop_set_message(t('The newsletter will be sent when the content is published.'));
}
// Clear the node cache for this node so that the status shows correctly when
// loaded.
cache_clear_all($node->nid, 'cache_entity_node');
}
3 changes: 3 additions & 0 deletions includes/simplenews.mail.inc
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ function simplenews_send_status_update() {
->condition('nid', $nid)
->fields(array('status' => SIMPLENEWS_STATUS_SEND_READY))
->execute();
// Clear the node cache for this node so that the status shows correctly
// when loaded.
cache_clear_all($nid, 'cache_entity_node');
}
}
}
Expand Down

0 comments on commit 778473c

Please sign in to comment.