0

I am using simplenews_scheduler in Drupal 7 to set up a weekly digest of new content. I am getting the following error on the screen and scheduled newsletters aren't going out, even after running cron. When I send it right away or send it as a test, it goes out and renders just fine.

Notice: Trying to get property of non-object in simplenews_scheduler_node_page() (line 600 sites/all/modules/simplenews_scheduler/simplenews_scheduler.module)

For reference, here is lines 598-601, referenced in the error:

foreach ($result as $row) {
    $node = node_load($row->eid);
    $rows[] = array(l($node->title, 'node/' . $row->eid), format_date($row->date_issued, 'custom', 'Y-m-d H:i'));
  }

I'm not sure this error is related as it seems to go only to loading editions already sent.

Drupal 7.65, simplenews 7.x-1.1, simplenews_scheduler 7.x-1.0-beta2

Does anyone know what could be causing this error or an alternative to sending a scheduled mailing? The module makes a copy of a base node each for each edition so it's kind of nice.

  • You should check if $node is an Object under the node_load() line. – Insasse Apr 2 at 11:31
  • What does this mean? How do I do that? – Christia Apr 3 at 11:52
  • if (is_object($node)) { $rows[] = array(l($node->title, 'node/' . $row->eid), format_date($row->date_issued, 'custom', 'Y-m-d H:i')); } Maybe you should open an issue on drupal.org/project/simplenews_scheduler – Insasse Apr 3 at 11:56
  • I still don't understand. Are you saying that the code is wrong? What is the code in your comment? Why would I be the only person to have this issue? – Christia Apr 3 at 12:15
  • 1
    I say that $node could be null in certain circumstances and the code you wrote above will try to get an object property "$node->title" which will error if $node is != object. I dont know your setup so I cant tell you what is going wrong on your side. You could also try to debug this with xdebug. – Insasse Apr 3 at 12:24
0

This issue was solved by deleting the node (master newsletter) and creating a new one. I had probably deleted a previous test edition, which caused it to start delivering the error. If there is only one test edition, don't delete it even if the master is preserved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.