I got this error when I try son send a newsletter.

    Notice: Trying to get property of non-object in SimplenewsSourceNode->__construct() (line 388 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromFormatted() (line 547 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromAddress() (line 554 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getHeaders() (line 470 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getHeaders() (line 476 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromFormatted() (line 547 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromAddress() (line 554 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getSubject() (line 594 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in template_preprocess_simplenews_newsletter_body() (line 2504 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/simplenews.module).
    Notice: Trying to get property of non-object in template_preprocess_simplenews_newsletter_body() (line 2506 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/simplenews.module).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in template_preprocess_simplenews_newsletter_footer() (line 2532 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/simplenews.module).
    Notice: Trying to get property of non-object in template_preprocess_simplenews_newsletter_footer() (line 2534 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/simplenews.module).
    Notice: Trying to get property of non-object in template_preprocess_simplenews_newsletter_footer() (line 2538 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/simplenews.module).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->__construct() (line 388 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromFormatted() (line 547 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromAddress() (line 554 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getHeaders() (line 470 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getHeaders() (line 476 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromFormatted() (line 547 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFromAddress() (line 554 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getSubject() (line 594 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).
    Notice: Trying to get property of non-object in SimplenewsSourceNode->getFormat() (line 568 of /home/webs_softlink/domain/www/sites/all/modules/contrib/simplenews/includes/simplenews.source.inc).

I'm working with php 5.3.2 ubuntu 4.18

Thanks

Oskar

Comments

bolecha’s picture

I have the same problem.
Have you found a solution?

killtheliterate’s picture

I was able to resolve this by:

  • navigating to the content type that is being used as a newsletter source
  • deleting the simplenews generated field for a newsletter category
  • unchecking the box that indicates that a content type shall be used as a newsletter
  • re-enabling the content type as a newsletter source

Tracing through the errors, it seems like the $category got lost somehow, maybe during a module upgrade, or something.

RKopacz’s picture

I tried the setps in #2 But no luck. I am still getting that same error. Using version 7.x-1.0. Any further thoughts?

RKopacz’s picture

Gentle bump. Anyone?

Würden’s picture

the steps in #2 didn't work for me either.
I have the same issue using 7.x-1.0 on a site where I upgraded from an old version of simplenews (mimemail and mailsystem too). I tried reinstalling all 3 modules completely but to no avail. Curiously though I don't have the issue on new sites with a fresh installation of simplenews so it seems strange it wouldn't work here.
Also the body is empty while the footer is the only thing displayed in the newsletter.

pslcbs’s picture

Don't know, but maybe my experience helps somebody.

I have two content types to send as newsletters and three newsletter categories.

  • One content type has the original category that it comes with Simplenews installation. Sending results = Newsletter sent ok.
  • Other content type has one custom category. Sending results = Newsletter not sent.
    Now I change the category to the original. Sending results = Newsletter sent ok.

Hope this helps

pslcbs

drewkeller’s picture

For me, I tried to make a custom content type a newsletter by manually adding the newsletter category field (bad idea). So now I have two categories: N/A and my actual category. After much digging around and trial and error, I figured out some tables in my database had been emptied. Namely, field_data_field_simplenews_term, field_revision_field_simplenews_term and other pairs for other custom fields I had added. Also, simplenews_newsletter was empty. So I manually added the data back in, once I figured out what the node ids for each node and the term id.

something along the lines of (change 64 to your actual node id and 36 to your term id, and of course 'mydatabase' and 'mycontenttype'):

INSERT INTO `mydatabase`.`field_data_field_simplenews_term` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `field_simplenews_term_tid`) VALUES ('node', 'mycontenttype', '0', '64', '64', 'und', '0', '36');

INSERT INTO `mydatabase`.`field_revision_field_simplenews_term` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `field_simplenews_term_tid`) VALUES ('node', 'mycontenttype', '0', '64', '64', 'und', '0', '36');

After getting this data back in the database, the test emails work without bunches of errors.

ajlow’s picture

Got same problem too...

Tried #2 but no luck either... :(

ajlow’s picture

OK, here is something I found out.

I installed simplenews, associated simplenews to a content type. Straightforward so far. Now, when I sent a newsletter from a node with content type that is now associated to simplenews and that was created before I installed simplenews, I got this error...

If you created a new node and then send a newsletter, it works!

Strange behaviour as the above steps on my local system (Mac OS X 10.8 with Drupal 7.19 and MAMP 2.0.3) didn't cause any errors whereas the above steps did on my Amazon EC2 instance...

I hope it helps other who have come across this particular problem!

RumpledElf’s picture

I had the same problem, I had existing content before installing simplenews, set my content type to a newsletter so all my content had no newsletter category set. With that field set, no errors.

alessandro rancati’s picture

Same problem here.

The error occurs if I add the newsletter category from the taxonomy page (/admin/structure/taxonomy/newsletter/add). Go check into the Newsletter category list in /admin/config/services/simplenews: the category will not be there.

The error can be fixed by FIRST removing all the wrongly inserted categories from the taxonomy list and by THEN adding the newsletter category from the proper page (/admin/config/services/simplenews/add/).

Then you will have to edit the pending newsletter issue(s) to reassign the proper category.

Warning: if you delete the wrongly inserted category (let's say "Customer news") and re-create it from the proper page with the same name ("Customer news"), the newsletter issue(s) will magically show the correct name but still point to the wrongly inserted, non existing category. You'll have to switch the issue's category to a different one, save, then edit and switch it back to the category of your choice.

mediaformat’s picture

This was my case:
After associating an exsiting content-type with Simplenews, by default all exsiting nodes of that type were not associated to a newsletter category (unselected radio button).

hanskuiters’s picture

I think I figured it out. I had the same errors when adding a newsletter category through taxonomy. I removed the term. Then I added a category through admin/config/services/simplenews/add. The errors are gone now.

iainh’s picture

For me it was the same as for @ajlow :

  • Sending a newsletter from content created before simplenews was enabled caused the multiple errors of the OP.
  • Sending a newsletter from content created after simplenews was enabled: everything was OK.
sumthief’s picture

I have the same problem. There are a way to reproduce it:

  1. Create new newsletter and associate it with one of newsletter group (term)
  2. Remove newsletter group (term)
  3. Try to send test mail. (I've tried to reproudce it with sending mails to general addresses but there are were no notices.)

I have made patch that works for me. If there are will be more information how to reproduce problem in other place I could to finalize patch.

sumthief’s picture

Status: Active » Needs review
Ives’s picture

I had the same problem as @iainH and @ajlow.
By resaving (no changes necessary) the nodes created before Simplenews was enabled, the errors went away and the newsletter was sent.