In simplenews.module, function simplenews_mail_mail, line 1623, there's an invocation of node_load:

$node = node_load(array('nid' => $nid, 'vid' => $vid));

This always returns a null node for me (Drupal 6.8, PHP 5.2.4, MySQL Ver 14.12 Distrib 5.0.51a) on every invocation, meaning that no messages are ever mailed to the subscribers (although, interestingly, the test messages go ok).

Looking at the docs for node_load:

node_load($param = array(), $revision = NULL, $reset = NULL)

it allows either an array of arguments, or two scalar arguments: $nid, $vid (node and revision ids). I'm not sure how the array approach would work (perhaps it won't work unless there's only one revision for the node?), but by altering the call to node_load to

$node = node_load($nid, $vid);

everything burst into life... Was there a specific reason for using the param array??

Hope this helps someone.

CommentFileSizeAuthor
#1 simplenews.355338.patch761 bytessutharsan

Comments

sutharsan’s picture

Status: Active » Fixed
StatusFileSize
new761 bytes

Nice catch, thanks! The attached patch is now applied. The reason for using the array was my interpretation of node_load() doc's. Looking closer there is indeed a difference in handling when the vid is passed in the array. The test behavior may be explained by static $node in node_load(), $node probably still contains the node object.

Status: Fixed » Closed (fixed)

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