Distinct recipients is not working
| Project: | Views Mail |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
I guess this is due to a change in CCK, but I just installed Views_mail (and dependencies), set up my newsletter in Simplenews, as described in the README and created a new view:
* Fields are usernode: email and usernode: name
* Page is presented showing 100 users per page and in "Views mail"
* No filters
* Sort criteria set to usernode:name ascending
I visit the page presented by the view and I get this warning, four times, every time:
warning: Invalid argument supplied for foreach() in /home/apps/wt/trunk/www/sites/all/modules/contributions/cck/fieldgroup.module on line 394.
Underneath the warning the user list and "Sent mail" options are presented as expected.
If I continue with "Send mail" and "Distinct" is set to Yes then it says "Ok to send to 0 recipients?" - it selects no one! If I set "Distinct" to No then all of my users are listed as expected. Whichever I select, I get the four warnings again on every page refresh. I suspect this is related and due to a change in CCK?

#1
I'm using content.module (CCK) 5.x-1.7 and usernode.module 5.x-1.3 and not seeing this problem.
#2
Thanks. I am on 5.x-1.6 of content.module - will update and report back.
#3
Hmmm, I'm now upgraded to content.module 5.x-1.7 ... still the same error. Strange! I'll try and find the time to dig a little further with the devel module. Trouble is, I have to fiddle with my PHP settings to stop devel.module from crashing Apache. =(
#4
If you can give me some more info, I'll take a closer look. Right now, I'm at a complete loss as to why this would be happening.
#5
Upgraded Views_mail to 5.x-1.2 and CCK to the latest version, but I'm still getting this problem. See attached screenshot.
It occurs to me the only "fieldgroup" on the page is the 'Send Mail' fieldgroup, so there must be some problem there. I've noticed something else strange. I don't have any newsletters available to choose from, even though I have created them. When I go to admin/content/newsletters it doesn't list my newsletters either.
So, I'm wondering if this might be that there is something wrong with Simplenews *combined with* Views_mail not correctly handling a situation where no newsletters have been created yet?
#6
As for the error message, I used the solution near the end of this thread: http://drupal.org/node/186775
As to newsletters not being listed here: admin/content/newsletters, sounds like a simplnews issue. As to newsletters being available to views_mail, you must first creae a newsletter group, then define it in views_mail settings. You can't define it in views_mail until it is created in simplenews.
#7
Re: "define it in views_mail settings" - thanks! I forgot about that because my user didn't have permissions so I didn't see the settings page. That much is now fine. I'll ignore the Simplenews issue for now.
Re: the error message, thanks for the link, but I *only* get it when viewing a Views_mail page ... nowhere else, ever. So I don't think that particular CCK bug is relevant in this case. Unless this now points to a bug with Usernode?? This is becoming quite a spider's web! ;-)
EDIT: And I don't think it's usernode as I use usernode in many other Views and Panels without seeing this error.
#8
Right now, I'm not sure where it is. I did NOT get the error at all, but then, I didn't have fieldgroup installed. When I did get the error, it was when I created any fieldgroup (totally unrelated to views_mail).
So, until someone comes up with a better solution, this is mines for now. http://drupal.org/node/186775 Unless, of course, it doesn't work.