Thanks for writing this module, it's a great idea!

I've installed this and activated it for the site.

However, when I look at my view that has an exposed filter, instead of the dropdown list that was there before, I now see, for each option (i.e., 7 times in a row; the content type filter has 7 options):

warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/views_checkboxes/views_checkboxes.module on line 83.

I've looked at that line in the file but I don't know enough PHP to figure this out :(

Thanks
m.

Comments

scottrigby’s picture

for me, the checkboxes look great (because I enabled multiple select).

BUT I am also getting the same warning:

warning: Invalid argument supplied for foreach() in (path)/modules/views_checkboxes/views_checkboxes.module on line 83.

ps, minor edit of this comment (removed specifics from path)

Anonymous’s picture

+1 Same error here.

txcrew

nschelly’s picture

I don't suppose any of you can send me a screenshot? Also, what type of filter is it? I'm using this to filter on taxonomy terms, but perhaps a different type of filter is causing the problems you're having?
-Neil

mpromber’s picture

I've tried using it to filter on node types.

I'll try to send a screenshot later; have it disabled and made some other changes to the view right now.

Thanks,
m.

p.s. minor typo edited.

Anonymous’s picture

StatusFileSize
new8.78 KB

Attached you will find a screenshot of the error. I just exposed a filter on the default taxonomy term view.

thanks,
txcrew

raymondllee’s picture

same error here, i'm exposing a taxonomy vocabulary with 3 choices when I get this error in a gmap view. i dumped the variables at this point, and I wonder if it's because the first option_id is a string "**ALL**" instead of an integer?

string
- ioption_id
**ALL**

integer
- icount
1

integer
- ioption_id
0

integer
- icount
1

integer
- ioption_id
1

integer
- icount
1

integer
- ioption_id
2

integer
- icount
1

raymondllee’s picture

StatusFileSize
new1.06 KB

I got this working by borrowing some code from the formtweaker issue thread. Here's my diff file.

scottrigby’s picture

StatusFileSize
new73.28 KB

re: #7
this diff hasn't worked for me. Here's my error attached:

nschelly’s picture

I'm sorry I haven't been back to this thread... I promise I will get working on a fix. I wonder if this actually related to the "**ALL**" option, as raymondlee suggest. I didn't use them or test them, but I can imagine this code interfering with that. That doesn't seem to be all of it, but I'll investigate more in the coming week I hope.
-Neil

scottrigby’s picture

re #8 -- oops!

You'll want to ignore that error in #8 - it was my fault - I had deleted a field that was being called by my location map view.

scottrigby’s picture

@ raymondllee -- your diff.txt in #7 works for me after all -- thanks!

mrf’s picture

Same error message, and the patch worked perfectly for me.

scottrigby’s picture

So raymondllee's diff (#7) needs to be made into a patch, right? I'm still new with all this, but that's the next step, isn't it (I'd do it if I knew how - still not there yet).
Then the patch would be committed if all testing seems ok (cause testing is already underway, and works so far)?
SCott

zmove’s picture

I have the same errors before patch, I have a very long list of :

# warning: Invalid argument supplied for foreach() in /sites/all/modules/views_checkboxes/views_checkboxes.module on line 83.

But the difference I have is that the exposed filters don't appears.

After patch, it don't work too, I have an error too :

# warning: Invalid argument supplied for foreach() in /sites/all/modules/views_checkboxes/views_checkboxes.module on line 88.

The error just change place because I put some code before, so the patch resolve nothing for me...

I have 6 exposed filters with multi select enabled. The exposed filters are content taxonomy fields, maybe it is not compatible...

nschelly’s picture

Title: Error message » Errors with **ALL** options in the exposed filters
Version: 5.x-1.x-dev » 5.x-1.1
Assigned: Unassigned » nschelly
Category: support » bug
Status: Active » Fixed

I'm renaming this issue to make it more appropriate to what I think the cause was. It seems those who've experienced the problem all the the **ALL** option in their exposed filters. I've now (based on raymondlee's patch) incorporated made the module skip those options and hide them, as his did. I also cleaned up the logic a lot in that section of the code, since it was really not clear even to me.

I hope everyone who was trying out his patch or still is having issues will try out the new dev version I released and let me know if it fixes your problems. Also, if anyone was getting this error but did not have **ALL** in their option list, please let me know (preferably in a new issue) so that we can investigate that as a separate bug.

Thanks...
-N

nschelly’s picture

Version: 5.x-1.1 » 5.x-1.x-dev
nschelly’s picture

Status: Fixed » Closed (fixed)
planctus’s picture

Status: Closed (fixed) » Active

I'm sorry i had to open this issue again, but i'm still having problems showed by drupal in line 83 in views_checkboxes.module file, and i see a great amount of that.
But worst... i've lost the selection box too, i see only the filter option (where it had not supposed to be) but not the items.
I'm using an exposed filter for a cck field with multiple values.
Without this module it works and i see the selecion box with the items i expected to see.
Activating the module the box disappear and i see an illogical field to choose from "one of them" and "none of them" and it makes non sense to me, cause it had to be a choice between a list or, better, between a checkbox list.
Thank you
Da.

nschelly’s picture

planctus,
Can you attach a screenshot of the form? Also, please attach an export of your view. I'll use that to recreate your issue.
-Neil

ckng’s picture

Version: 5.x-1.x-dev » 5.x-1.2
Status: Active » Needs review
StatusFileSize
new1.36 KB

I'm still facing same problem with 5.x-1.2 & 5.x-dev, the initial patch in this thread actually solves the line 83 problem.
There is another problem on line 88 as seen by zmove, due to below.

Apparently there is a "- Please choose -" in the options for some (possible bug in View?), see the dump

 #options = Array [5]	
	**ALL** = (string:5) <All>	
	 = (string:17) - Please choose -	
	0 = Object of: stdClass	
	1 = Object of: stdClass	
	2 = Object of: stdClass	

The attached patch skip if the option is not an array (as in the case for "- Please choose -").

Additional minor stuffs on the patch:
- remove ending ?>
- shorten the code on option

Please test it out if it works for your case. So far it solves all the errors I had.

planctus’s picture

i'm sorry but i disabled checkboxes in the meantime... i can't show you a screenshot, but i will try to help you doing this again,
just, i don't have time now, i'll do as soon as i can.
Thanks,
Da.

nschelly’s picture

planctus,
Does the patch ckng just submitted repair your issues?
-Neil

nschelly’s picture

I just posted a new release, 1.3 that I suspect will repair the issue you're reporting. It was seperately reported here: http://drupal.org/node/215935 and it came from having view filters that were not based on taxonomy terms. As such the options weren't represented by arrays of objects (as with terms). They were arrays of strings and didn't need rewriting as a result.

I think the new release will fix that - it has in my testing at least.
-N

planctus’s picture

I'll give it a try...
we're in production now,
come to see us at http://inkscapegallery.net
I've two test environments, i'll try the patch and then i'll report.
I'm sorry for the delay, i was really busy working on the inkscape gallery release.
Thank you
Da.

planctus’s picture

it seems to work with the new release!
I just have a strange layout but i think it is my css related...not your fault :-)
But the checkboxes are there and everything seems to be fine.
Da.

nschelly’s picture

Status: Needs review » Closed (fixed)

I'm closing this again. I think this is resolved. Please open a new ticket if you have continued problems or check open ticket if you have a problem that resembles the discussion here. It seems that a few vaguely related issues have combined here, making it more confusing for me to follow exactly who has what problem.
-N