- Issue created by @pdewringer
- 🇳🇱Netherlands pdewringer
What we have done currently is move that if statement to under the if where gets checked if the element has options
- @pdewringer opened merge request.
We have a filter on taxonomy terms in our overview with the option "hide filter, if no options" enabled to hide if there are no results for the select. What we have noticed is that the filter will still always show up even though there are no options for the select.
Add view with a filter which is able to select multiple values and enable the "hide filter, if no options" option.
What we noticed was that we never get into the if statement where the field is disabled. There is an if check with an else if the view results are empty, if that is the case set the access of the filter to false, but to get to the other if check:
if (
!empty($settings['options_hide_when_empty'])
&& (
(count($element['#options']) == 1 && isset($element['#options']['All']))
|| empty($element['#options'])
)
) {
$element['#access'] = FALSE;
}
You need to get through the options empty check, which we dont have because we dont have options:
if (!empty($element['#options'])) {
Active
3.0
Code
What we have done currently is move that if statement to under the if where gets checked if the element has options