Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Vincent

Bug: ACF Sorting/Filtering for true/false Fields

Sorting and filtering for true/false ACF Custom Fields is not behaving correctly for example if the meta_key is not set then this should be automatically “false” for the filter. Sorting doesn’t work at all.

7 years, 3 months ago
Vincent

Sorting for users is in general buggy with ACF, when I want to sort a field it behaves like a “filter” and doesn’t show the entries which have no value for the sorted column.

7 years, 3 months ago
Vincent

I am using it in the Users section just to put that in the right context.

7 years, 3 months ago
Stefan van den Dungen Gronovius
Developer

Hi Vincent,

Are you aware of the setting ‘Show all results when sorting. Default is off.’ on our settings page?
For boolean field and more specifically ACF boolean fields you have the following options

empty = True/False (determined by user)
0 = False
1 = True

So if you sort on a boolean field, it tries to sort on 0 and then 1 but it with the setting above off, it ignores all records without any value. This is intended because the Custom Field column is made for all custom fields (not just ACF) and we simply don’t know how an empty value should behave (true or false).

Since you’re using ACF you could try our ACF addon for Admin Columns Pro (business license and up) because for ACF users we already know more about the context of your fields and we know how empty values should be handled. So the we believe both filtering and sorting does work as expected for the Custom Field column as this is a solution for all custom fields implementations.

7 years, 3 months ago
Vincent

The setting “Show all results when sorting.” made the trick. Thanks.

7 years, 3 months ago
Stefan van den Dungen Gronovius
Developer

Great your problem is fixed, I will close this ticket.

7 years, 3 months ago

You must be logged in to reply to this topic.