Skip Navigation

[Resolved] Filtering by URL parameter returns all records when url parameter is missing

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 3 years, 9 months ago.

Assisted by: Jamal.

Author
Posts
#1703285

I am trying to: Use an URL parameter to pass a search parameter to a page with a view on it.

Link to a page where the issue can be seen: Any

I expected to see: No results because a match could not have satisfied the view filter section.

Instead, I got: All records found.

If the URL parameter is missing entirely, the search results return all records. This is wrong. The search should work the same way that all toolset filtered searches work, returning matching results within that context and the contents of the [not_found] context if there are no matches or the parameter does not exist. Anything else is illogical and a bug.

#1703491

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

If the URL parameter is not passed, it is expected to have all the results, because that is the match. Toolset is trying to filter by value(from URL param), but that value is not passed, so Toolset does not perform any filtering and we return all the results.

If you would like to have no results when the URL param is empty, check these previous replies, they provide a solution for the same use case:
- https://toolset.com/forums/topic/display-only-filtered-values/
- https://toolset.com/forums/topic/empty-initial-search-value/#post-592517

I hope this answers your question. Let me know if you have any doubts.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.