Hi there,

As you can see the title of this bug report, I have an error when I submit a new newsletter issue :

  warning: Invalid argument supplied for foreach() in sites/all/modules/simplenews/simplenews.module on line 365.

The newsletter is still sended even with the error.

zmove

CommentFileSizeAuthor
#6 simplenews.194499.patch1.88 KBsutharsan

Comments

sutharsan’s picture

Are you using the Category module? Please be informed that Simplenews is currently incompatible with the Category module. See http://drupal.org/node/115693 for the status of this issue.

zmove’s picture

No, I'm not using the category module.

However I have simplenews roles and mime mail.

sutharsan’s picture

Status: Active » Postponed (maintainer needs more info)

I can not reproduce this error message with simplenews_roles and mimemail.
Please find out which module is causing this error and in which situation.

farrell’s picture

I just had a similar problem, but mine was on line 372. I inadvertently had not assigned a taxonomy to the node type -- actually, it seems to have been wiped out with an upgrade -- and with no taxonomy it created the same error and the newsletter was not sent.

theorichel’s picture

I have the same error, though on line 369. Have not Category installed, but work with Taxonomy. Have not assigned a Taxonomy though (it assumes nr 1 if I am right). Newsletter is sent. Do not have Simplenews roles, only Simplenews-Template.

Thanks

sutharsan’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.88 KB

Errors like these should not be presented, but handled by the system and you deserve more meaningfull messages. The attached patch will give you this. Please test the patch and give us your results.

lhtown’s picture

Sutharsan,

Thanks a million for the patch! I just installed it and figured out my problem in less time than it took to install the patch. I am thinking about printing out the patch and getting it framed I am so happy! I was about to either pull out my hair, dedicate the next few days to figuring it out, or put off my project.

My problem was that a test newsletter would send, but it would not email anything to my mailing list even though it says it was "sent."

After I installed the patch, it gave me an error message about the taxonomy, and I quickly realized that even though a newsletter taxonomy had been created, it was not assigned to the newsletter content type. I assigned the newsletter taxonomy to the newsletter content type and all is now rosy and seems to be working perfectly.

lhtown

theorichel’s picture

I have never understood why on so many places patches are offered, instead of the patched modules themselves, that we can upload the way we are used to?

I really hate to go into commandline hell.
I do this once a year. Since it is likely that I will have started a new system in that year, the Putty program is not available anymore. So I download it.
But it is along time since I used it so I will have to learn that again.
And since I havent accessed linux in along time I must learn to use it back again.
Of course I can manage that, but it takes a lot of time and is especially stressful. And that is all before the patching itself.

sutharsan’s picture

Status: Needs review » Fixed

Patches are the step inbetween a problem and a final solution. A way for a developer to say, try this, it works in my test environment, please test if it works for you. I would prefer that at least one other tests my patches before I commit them. But from the very few test results I get reported back you are not the only one having trouble to work with patches.
Before I learned to use any of the patching tools I did do the patching by hand: Download the right version of the module, open the source file in a text editor and apply the patch by removing and inserting lines of code. Upload the changed module to a test site (after backing up the original) and try the result. For small patches like this one this is a good alternative.

But in this case I have better news. The patch is now committed :)

theorichel’s picture

Status: Fixed » Needs review

OK wonderful, many thanks!

But to be clear: it is apparently not committed in version 5.x 1.2 cause that is where I am still having this error.

Thx

Theo Richel

ancym’s picture

Hey Thanks for the simplenews module - it is essential to me. So when I couldn't get it to work, it was seriously bad news!

Details here - http://drupal.org/node/220866

Basically, Newsletter issue was already added as a content type, but I did not get the list to select newsletter type from (and therefore could not send a newsletter), until I went to

mysite/admin/content/taxonomy

That is, in the admin menu, Site building -- content management - categories - list

and checked the box next to newsletter issue...

Anyway, I see that there are quite a few comments, all dealing with this same issue :

http://drupal.org/node/219029

http://drupal.org/node/194499

http://drupal.org/node/224312

Maybe more, but I have not gone back any further...
Seems like we are not alone in missing this step - maybe it would be worth adding to documentation somewhere? Sorry I do not know how to do that...hoping that adding it here will help others.

Thanks again for a great module.
(Sorry if you are already aware of all of this...)

sutharsan’s picture

Status: Needs review » Fixed

Are you using the latest 5.x-1.x-dev version? This error should not occur any more and now gives more information on how to resolve.

I know that this error occurs frequently last months but no one has described steps to reproduce this error and I can not reproduce it from a clean install either.

The fault is know to occur when upgrading by disabling contrib modules, upgrading and then enabling the modules again. But this is not simplenews related but general for all modules. But also for upgrades the 5.x-1.x-dev version performs is better.

@TheoRichel: a 5.2 version will be released when 5.x-1.x-dev has proven to be stable.

ancym’s picture

The version is 5.x-1.2

This was an upgrade, part of upgrading site from 4.7 to 5.7.

Sorry, I will have to ask the person who actually performed the upgrade if you would like anymore details...

Anonymous’s picture

Status: Fixed » Closed (fixed)

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