Cms: Empty taxonomy parameter causes zero results

Created on 25 Aug 2020  路  7Comments  路  Source: statamic/cms

Bug Description

In v2, I could use the following code, and if there was no category query string, it would return all results. This was a super easy way to not have to duplicate code inside conditionals.

{{ collection:blog limit="9" paginate="true" as="posts" taxonomy:tags="{ get:category }" }}

In v3, the collection tag returns nothing if there is no category query string. It also returns nothing if the taxonomy:tags parameter is empty, like if you do this:

{{ collection:blog limit="9" paginate="true" as="posts" taxonomy:tags="" }}

Ideally, this would behave the same way as in v2. This would ease migration pains, as well as allow for cleaner code.

Environment

Statamic 3.0.0 Pro
Laravel 7.25.0
PHP 7.3.17
No addons installed

  • Fresh install from statamic/statamic, then migrated from v2 with official migrator plugin

Most helpful comment

I'll try and work this into an upcoming release.

All 7 comments

I need this to work as in V2 to be able to successfully migrate multiple of my V2 sites. + 1!

@fitzage Did you find a way around this, in v3? Got everything else working after migrating my online store from v2 to v3, but this is crucial, as my product listing index is dependent on filters to give a good user experience.

https://github.com/statamic/cms/issues/2454

I just created multiple collection loops wrapped in conditional statements for now. Having to duplicate the code annoys me, but I haven鈥檛 figured out how to make a custom filter that works.

I'll try and work this into an upcoming release.

I've submitted a pull request to implement/fix this issue: #2672.

THANK YOU FOR THIS

馃帀 @damcclean 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philippgrimm picture philippgrimm  路  3Comments

robdekort picture robdekort  路  3Comments

filipac picture filipac  路  4Comments

riasvdv picture riasvdv  路  4Comments

jimblue picture jimblue  路  3Comments