Closed tao closed 2 years ago
It seems that changing from sort="order|asc"
to sort="order:asc"
allows it to render the page.
The colon syntax is what's documented. In your snippets you show sort="order:asc"
but in your comment you mention that's what works. I'm confused. Can you confirm what's broken and what works?
Sure, sort="order|asc"
worked in 3.2.29
but using that in 3.2.30
caused an error. I now switched to sort="order:asc"
and the bug disappears.
The code before snippet had:
{{ taxonomy from="events" sort="order|asc" }}
And now it looks like this:
{{ taxonomy from="events" sort="order:asc" }}
Maybe updating the sort method in 3.2.30
to allow subfields ended up fixing a bug that existed before which allowed order|asc
to work without breaking. Although I'm not quite sure yet how it's related to the file_put_contents
error.
Yeah looks like it.
sort="order|asc"
says to me... sort by the order
field then by the asc
field.
You probably didn't have any asc
values, they'd all be null. But order
would be ascending anyway so it looked like it worked.
Not sure about the error either though.
Oh probably because when we look for subfields using foo:bar:asc
... if the last chunk is asc
or desc
, it takes the first chunk (foo:bar
) as the field name.
Since you are just doing "sort by the asc
field"... the chunk before asc
was... nothing. So it failed when it tried to load the nothing index.
The "fix" for this would be to throw some other kind of exception. Either way, you'd be getting an error. I'd say just fix your template. 👍
Also make sure you specify the field name.
This worked before the merge:
collection:products sort="asc"
But you'll have to do:
collection:products sort="title:asc"
Just chiming in, I had this issue too, the prescribed fix worked for me!
Bug description
All I've done is update to
3.2.30
and run astache:refresh
and I'm getting this error. I downgraded back to3.2.29
and it works fine, and when I updated again to3.2.30
it caused the same bug.I've tried clearing the stache and the cache, the views, changing permissions on the storage folder... but nothing seems to help yet, and downgrading to
3.2.29
fixes the problem.The code section that isn't working is related to taxonomies, fetching the event taxonomy and listing all entries in the events collection that matches.
How to reproduce
I'm not sure what else to say except the new update caused the bug. I can try debug it more and see if I can find anything...
Logs
Versions
Statamic 3.2.30 Pro Laravel 8.79.0 PHP 8.0.6 elvenstar/statamic-meilisearch 0.1.3 statamic/ssg 0.9.0
Installation
Fresh statamic/statamic site via CLI
Additional details
We're using Statamic multi-site.