I spent some time identify the error. Now i known for sure from where it came, but I don't know how to correct it.

I have a global filter (only one), on a taxonomy FIELD (not view).
To reproduce the error, I only have to to go to my profile and save it, after I have configured a block.

I get a error :
Warning: Illegal offset type in form_type_checkboxes_value() (line 2338 of /var/www/drupal/includes/form.inc).

when I use "Multi choice check boxes" (checkboxes) widget (other widget works well).

I tracked the error down to

function global_filter_create_simple_widget($filter_key, $options, &$form, &$form_state) {
  $default_value = isset($form_state['input'][$name]) ? $form_state['input'][$name] : global_filter_get_session_value($name);

but I don't know how to correct it.

$default_value = array(); correct the warning, but then, my default values in the profile are ignored.

Set global filters according to the user profile upon login is not checked or checked (no difference)
Set global filters according to the user profile when saved is not checked

Error is the same on dev version.

Comments

RdeBoer’s picture

Thanks @ybabel for your report.

Interesting you get the error also when none of the profile options are checked.

I hope I can set time aside for this next week.

Rik

RdeBoer’s picture

Sorry this fell between the cracks.
Is this still an issue?

GemQueen’s picture

It is still a problem. I have narrowed it down to the case where the "Optimize" option is not ticked, and if I save a node that does NOT display the global filters block(s), but DOES contain taxonomies used by the global filter blocks, I get this same error. On my website, I have 7 global filter blocks, arranged in a single tabbed block, so only one is visible at a time. I don't think this matters, but I accomplished this with a mini panel using panel style pack module to get the vertical tabs. I do not use the "Set" button, so I was having problems with the global filter working correctly on the tabbed blocks, hence untick the "optimize" checkbox and suggested and it is working great.

Because of this, global_filter_create_simple_widget gets called A LOT. Here are some things I noticed:

1) The error occurs when I make a change to a content type that contains the taxonomy that is contained in the global filter widget. The taxonomy selections don't have to change, any change in the content will trigger the error. So my guess is something is happening during the submit process that it causing something funky with the filter creation.

2) The global filter block cache disappears - I can't figure out why - and it happens often, so the code that is supposed to be preventing regeneration of the widget runs more often that it is supposed to.

Hope this helps - if I get some more time I'll see if I can figure it out. It isn't causing any failures the end user would see, but it would be nice to figure it out just in case.

RdeBoer’s picture

Bummer....
Patch anyone...?