countActiveFilters() is as follows. This works fine when using a text input filter or a select filter with manual options. But when using a select filter based on a relationship the page crashes. Is there any way to improve this code? Thanks in advance!