I have about five selective exposed filters in a view, plus a couple of basic exposed filters (numeric, with operator is between ; date, with operator is greater than).

Everything works as expected, playing both with basic & selective filters returns correct sets of results, this is just awesome! But whenever I select a value with one of the basic filters which would return "no result", it ends with a out of memory error.

I hope it is a misconfiguration of mine, but I already searched a lot and couldn't find any reason. Is there any known incompatibility ?

Thanks for your reply and for all the work done !!

Comments

Kojo Unsui created an issue.

david_garcia’s picture

Thanks for you report.

Out of memory is probably some sort of edge case bug. You'll need to catch this with a debugger or tracer and see if there is a infinite loop or something like that somewhere, or a recursive piece of logic.

Kojo Unsui’s picture

Thanks for your quick reply ! The error message reported that the bug comes from Better exposed filters, line 403 of better_exposed_filters.theme.
I'm not really used to debug this kind of problems. I did put a dd(debug_backtrace()) there, but with that out of memory behaviour, it seems to be useless since the process never ends with any kind of output ...

This occurs in theme_select_as_tree($vars) which themes taxonomy-based exposed filter as nested unordered lists... It seems that whenever there are no more options for the current filter, because removed by selective filters, the BEF logic gets confused...

In my case, a simple if( empty( $element['#options'] ) ) { return; } at the beginning of the function did the trick, but I'm afraid there's a deeper reason between Better exposed and Selective filters logics ?!

I'm sorry at the moment I'm not able to purpose a more abstract or general solution... If you have some instructions to debug better I'll do my best. Thank you