After the commit 2328c3c7 for issue #1261844: views_handler_filter_in_operator does not work with optgroups. (thanks a lot to git bisect !), exposed filters having some explicit value options and have the "Limit list to selected items" option checked generates broken options lists, where all the actual values are replaced by 1.
I'm attaching the export of a rather simple Views that demonstrate the problem.
The problem is the the form_options_flatten introduced to fix #1261844: views_handler_filter_in_operator does not work with optgroups. clobbers the actual values in $this->value_options, and replaces them by 1 whenever it's a simple key. As long as the values aren't used afterwards, that's ok-ish, but if the exposed filter is configured to Limit list to selected items, then those options are re-used for creating the actual widgets, leading to the broken display.
I'm working on a patch to fix that.
Comment | File | Size | Author |
---|---|---|---|
#1 | 0001-Bug-1302494-by-DeFr-Exposed-filters-values-sometimes.patch | 1.14 KB | DeFr |
broken_exposed_filter.txt | 6.55 KB | DeFr |
Comments
Comment #1
DeFr CreditAttribution: DeFr commentedAttaching promised patch. This makes the use of form_options_flatten more in line with what's done in node_filter_form_submit, creating a temporary array that's just checked for isset and not clobbering the actual values.
Comment #2
DeFr CreditAttribution: DeFr commentedForgot to switch the status to needs review, sorry for the noise.
Comment #3
asplamagnifique CreditAttribution: asplamagnifique commentedwith my version of views 6.x-3.x-dev, values of exposed filters passe at 1 after one action on my views
patch applied, which corrects the problem filters
Comment #4
dawehnerThis kind of patch got already commited some time ago. Thanks for providing a patch.
Comment #5
DeFr CreditAttribution: DeFr commentedNo problem, in fact, looking at the commit (fe453f13) , I can see that it's this patch that went in and the issue simply wasn't updated. That works for me :-)
Comment #6
dawehnerOh this happens much too often at the last time.