You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes when getting collections filtered by taxonomies, we get a countable error.
How to Reproduce
The code which causes the error for us is: {{ collection:blog_posts as="posts" limit="6" :taxonomy:categories="categories" :slug:not="slug"}}
Extra Detail
I believe this could have been introduced in #2672 as the issue wasn't there until we updated statamic to 3.0.20. To get around the 500 I've used is_countable on line 312 of Statamic\Tags\Collection\Entries to check if what's being passed in is countable before counting it. Although; I'm not sure if that's going to cause other issues, and it would mean the minimum supported PHP version would need to be bumped up to PHP 7.3.
Currently the variable being counted seems to be set to null, which could be related to me using the eloquent driver? I'm not sure. But in the past the variable has been of type Statamic\Taxonomies\LocalizedTerm, which doesn't implement countable hence the error.
Bug Description
Sometimes when getting collections filtered by taxonomies, we get a countable error.
How to Reproduce
The code which causes the error for us is:
{{ collection:blog_posts as="posts" limit="6" :taxonomy:categories="categories" :slug:not="slug"}}
Extra Detail
I believe this could have been introduced in #2672 as the issue wasn't there until we updated statamic to 3.0.20. To get around the 500 I've used
is_countable
on line 312 of Statamic\Tags\Collection\Entries to check if what's being passed in is countable before counting it. Although; I'm not sure if that's going to cause other issues, and it would mean the minimum supported PHP version would need to be bumped up to PHP 7.3.Currently the variable being counted seems to be set to null, which could be related to me using the eloquent driver? I'm not sure. But in the past the variable has been of type
Statamic\Taxonomies\LocalizedTerm
, which doesn't implement countable hence the error.Environment
Statamic 3.0.20 Pro
Laravel 7.29.3
PHP 7.4.12
statamic/eloquent-driver 0.1.0
statamic/seo-pro 2.0.14
Install method (choose one):
statamic/statamic
The text was updated successfully, but these errors were encountered: