Skip Navigation

[Résolu] View sort with numeric field with null value causes no records found

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Marqué : 

This topic contains 2 réponses, has 2 voix.

Last updated by martinE-4 Il y a 8 mois et 3 semaines.

Assigned support staff: Minesh.

Auteur
Publications
#1922663

I noticed that when I sorted by a custom numeric field which had no values in it, that the view returned "No records found"

When I tried to adjust the sort to something else in the Block editor the view became corrupted and would not return to working properly.

FIX: I put zeroes in the numeric sort field so that there were no null values, and then created a new view in the block editor and it worked fine after that.

Suggestion: sorting with a numeric cpt with null values should not return "No records". It should default to the date published.

#1922855

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset follow the WordPress standard and with WordPress if you have a custom field that does not save any value, you will not find any related meta key will be added to postmeta table.

So, this is expected and we can not do much here. You will to keep using the workaround you shared.

#1927105

Thank you! At least I know how to fix it. Too bad there can't be some sort of override, default for such situations.