When creating filter by some field in views index, I get:
Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 2251 of /var/www/dev.kidmart.ru/www/includes/form.inc). =>
The problem is that form_type_checkboxes_value gets empty string '' instead of empty array.
To get rid of the error, I changed the line 100 of handler_filter_options.inc from
'#default_value' => isset($this->value) ? $this->value : array(),
to
'#default_value' => isset($this->value) ? (array) $this->value : array(),
not sure if that is a correct fix, but it helps.
Comments
Comment #1
davidwbarratt commentedAnother solution could be to simply change the function like so:
Comment #2
maestro82 commentedHi Guys,
In which module (or dir) is file: "handler_filter_options.inc"?
Thank you for answer.
Comment #3
drunken monkeyThanks for reporting and debugging this! The solution in #1 seems fine, I created a little patch from that. Could someone confirm this solves the issue?
It's in
search_api/contrib/search_api_views/includes.Comment #5
drunken monkey#3: 1433720--options_filter_array_default-3.patch queued for re-testing.
Comment #7
bago commentedI just updated search_api and reapplied this... anyone knows why does CI fail testing?
Comment #8
JvE commentedRerolled patch against latest dev.
Comment #9
kenorb commentedBacktrace:
Views similar issues:
#762238: warning: Invalid argument supplied for foreach()
#1018564: views arguments error
Comment #10
kenorb commentedTested patch, it fixes the problem.
Comment #11
drunken monkeyGreat to hear. Committed!
Thanks for testing, and thanks again to davidwbarratt for providing the solution!