I wrote my own handler based on views_handler_filter_in_operator handler, where I gave $value_form_type the 'radios' value.
After opening the filter, I got the following error message:
warning: htmlspecialchars() expects parameter 1 to be string, array given in /Users/york/www/lada/includes/bootstrap.inc on line 857.
warning: htmlspecialchars() expects parameter 1 to be string, array given in /Users/york/www/lada/includes/bootstrap.inc on line 857.
I started investigating the problem, and I found that, the variable type of the #default_value of the 'radios' type form is array instead of string.
Because of that, the admin_summary() function also returned a wrong value.
I managed to rewrite these in my own hander, so I could continue working, but while testing expose filter, I came across a following error, when generating a 'select' form element:
An illegal choice has been detected. Please contact the site administrator.
It took me a while to recognize that, this is because the default value of 'radios' field is string instead of array.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | views-939468-1.patch | 1.15 KB | mr.york |
Comments
Comment #1
mr.york commentedI modified the handling of 'radios' value in 'admin_summary' and 'value_form' functions.
I couldn't find the way to avoid the error, when using expose filter though.
To avoid the problem above, I modified my own handler the following way:
Comment #2
dawehnerJust as a reminder. You might fix the codestyle issues before setting it to "needs review".
Comment #3
mr.york commentedSorry, but I can't say, I understand what do you want me to do here. I can't see anything in the code, that is against the coding standards. I can't do anything more to solve the problem now, because I don't know where to debug the other error I found. That's why I set the issue to 'needs work'. I need some info regarding where should I correct the code, or someone, who can do this instead of me.
Thank you in advance.
Comment #4
dawehnerJust a short example
should be
Comment #5
dawehnerAnd even better
Comment #6
mr.york commented