Element - List view settings - Filters

jflash

Member
After updating toadys github source on my site join works, but now element filters show in dropdown only one option - 'All'. If i use 'filter type'='field' then field works but i need Dropdown :S
 
Hi which element type is it?
What exact filter settings do you have?

thx
Rob
 
Rob - the problem here is in unmergeFilterSplits() in the element model. Around line 1885 ...


PHP:
				unset($rows[$j]); // $$$ r4ob 01/08/2011 - caused empty list in advanced search on dropdown element

The problem seems to be that JSONtoData() is always going to return an array, even for simple non-array inputs, so we're always going to execute the is_array() loop, the value is always going to be in $allvalues, so we're just going to end up removing the $rows[] data for that $val, without adding it back inside that loop.

I haven't attempted a fix. Although I suspect the fix is to set a flag if we actually find anything that wasn't in $allvalues, and only unset() the $rows entry if the flag is set.

-- hugh
 
I went ahead an did the $found flag thing. Fixes this issue, I'm just not 100% sure if it'll break any other usage cases, as I don't know what usage causes the $rows entries to actually be arrays, i.e. require the 'unmerge', so I can't test for the original intent of the method.

But it should now work for the simple case of field elements as dropdown filters.

Fix is on github.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top