On my view I am getting the message 'An illegal choice has been detected. Please contact the site administrator.' when I try to paginate when no filters have been selected. If I choose a filter, pagination works fine. The issue seems to be that BEF is adding blank parameters to the query string.
For example, the href for the next page button, when no filters have been applied looks like this:
games-applications?title=&sort_bef_combine=&sort_order=&sort_by=&page=1
Note the three empty variables. If I choose a sort by option, the href for the next button now looks like this
games-applications?title=&sort_bef_combine=created%20DESC&sort_order=DESC&sort_by=created&page=1
Interestingly enough, if I use title filter, but leave the sort filter blank the href for the next button looks like this:
games-applications?title=E&sort_bef_combine=%20&sort_order=&sort_by=&page=1
The pager works, despite only a space in the sort_bef_combine variable and the other two being blank.
Also if I create a url without the empty variables, the next page works:
games-applications?page=1
Has anyone else run into this? It sounds similar to @djsmacedo issue on #1867418: An illegal choice has been detected. Please contact the site administrator.. I've attached an export of the view.
Comment | File | Size | Author |
---|---|---|---|
#7 | views-exposed-type-230393.patch | 1.2 KB | aufumy |
Comments
Comment #1
ryan.armstrong CreditAttribution: ryan.armstrong commentedTracing the error has led me to believe that this is an issue with Views rather than BEF. I can see the empty parameters being passed via the $input variable in the pager plugin in views.
Comment #2
troybthompson CreditAttribution: troybthompson commentedI'm having a similar issue. When I disable BEF, I'm still getting the problem. It happens when I paginate using the default sort.
Comment #3
BarisW CreditAttribution: BarisW commentedHere's a way to fix it, until this gets properly fixed upstream: http://drupal.stackexchange.com/a/57790
Comment #4
aufumy CreditAttribution: aufumy at Red Rocket Creative Strategies commentedThe stackexchange link didn't work for me, this patch does. The checkboxes fields had grouped chosen instead of single. Grouped threw this error, but not single.
Comment #5
aufumy CreditAttribution: aufumy at Red Rocket Creative Strategies commentedComment #6
wilco CreditAttribution: wilco as a volunteer commentedHi all, so I noticed with the patch above (which helped me greatly) that there's a use case where this will return a
PHP Notice: Undefined index: #type in views_exposed_form_submit()
The following re-roll of the patch adds an extra assertion to check for this missing "#type" key.
I've also renamed the patch so give it more description. Hope this helps others too.
Comment #7
aufumy CreditAttribution: aufumy at Red Rocket Creative Strategies commentedRe-rolled the same patch against 7.x-3.14
Comment #8
aufumy CreditAttribution: aufumy at Red Rocket Creative Strategies commented