Closed (fixed)
Project:
Views Checkboxes
Version:
5.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
12 Feb 2008 at 14:37 UTC
Updated:
21 Feb 2008 at 14:10 UTC
The module (1.3) seems to work, but I get this error:
warning: "Invalid argument supplied for foreach() in /modules/views_checkboxes/views_checkboxes.module on line 89."
Comments
Comment #1
pinow commentedThis only seems to happen when I expose a taxonomy-filter specific(!) for a vocabulary.
"Taxonomy: Terms For Vocab1"
Comment #2
pinow commentedI used the following piece of code from http://drupal.org/node/215935#comment-712436 to fix it:
if (is_object($form['filter'.$count]['#options'][$option_id])) {
foreach ($form['filter'.$count]['#options'][$option_id]->option as $num => $val) {
$newoptions[$num] = $val;
}
} else {
$newoptions[$option_id] = $option;
}
But then I had the "- Please choose -" option visible. So I added the following beneath the line where you disable ***ALL***:
if ($option_id === '') continue;
Comment #3
nschelly commentedI can't seem to recreate this - I can't figure out how to make a taxonomy selection show a "- 'Please choose -" listing. Can you send me an export of your view so I can see exactly how you have it configured?
I think you're saying that doing this fixes it by hiding the "- Please choose -" option. Is that correct?
> But then I had the "- Please choose -" option visible. So I added the following beneath the line where you disable ***ALL***:
> if ($option_id === '') continue;
-N
Comment #4
pinow commentedNo, I fixed it by using this piece of code:
if (is_object($form['filter'.$count]['#options'][$option_id])) {
foreach ($form['filter'.$count]['#options'][$option_id]->option as $num => $val) {
$newoptions[$num] = $val;
}
} else {
$newoptions[$option_id] = $option;
}
But then the first checkbox-option was "- please choose -".
And I fixed that by adding this:
if ($option_id === '') continue;
Comment #5
nschelly commentedI just posted a new release with your bug fix. I don't see how it can harm things, but I couldn't confirm that it works or not because you didn't send what I asked for to recreate the problem.
It's version 3.1 - please read the release notes as a few changes have occurred.
-N