Sometimes things don’t work as expected. If you’re unsure whether something is a bug, please feel free to reach out - I'm more than happy to help.
Below, you’ll find some of the most common issues you might encounter while using Livewire Filters.
Blueprint [something] not found.
This likely means that the collection or blueprint handle was entered incorrectly. Keep in mind that the blueprint handle is usually the singular form of the collection name. For example, the blueprint for the pages
collection is typically page
.
Field [handle] not found in blueprint [something].
Similarly, this error likely indicates a typo in the field handle or an incorrect blueprint selection. Double-check your collections and blueprints to ensure accuracy.
strtolower(): Argument #1 ($string) must be of type string, array given
This usually occurs when a filter option is selected that isn’t compatible with the chosen condition. The most common cause is a field saved as an array being used with an is
or contains
filter. To resolve this, refer to the query scope documentation on using the multiselect
scope.
Even if you have a taxonomy terms field in your Blueprint for the taxonomy filtering to work correctly it needs to be selected in your Collection's configuration, in the Content Model
section.
Clear and warm your Content Stache from Utilities -> Cache. Sometimes the Stache will have old data.
Due to the way Statamic Livewire Filters work, certain features, such as the URL Query String, may not function correctly with static caching by default. This occurs because some filter values are preset on page load, and these values are then saved in the cached HTML response as Livewire’s snapshot.
To prevent this, you need to enclose the LivewireCollection
component in a nocache
tag, for example:
{{ nocache }}
{{ livewire-collection:cars paginate="6" }}
{{ /nocache }}
However this will cause the Livewire assets to load twice and will create further problems. To prevent that, publish Livewire's config file:
php artisan livewire:publish --config
And edit the config file to disable auto-injection of the frontend assets:
config/livewire.php
'inject_assets' => false,
Finally you need to add the {{ livewire:scripts }}
and {{ livewire:styles }}
tags in your layout file. Read more here.