-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taxonomy filter stopped working for integer values #2446
Comments
This is 'probably' related to the stricter YAML parsing in Symfony 4.2 (https://learn.getgrav.org/16/advanced/grav-development/grav-16-upgrade-guide#yaml-parsing) I will investigate because it probably needs to have the data normalized to strings. |
I fixed it by doing this at "onPageProcessed" (here in context). Works for me now, but maybe has side effects for others who depend on integers elsewhere 🤔
|
Please try the fix I just commited above. Thanks! |
This fix raises some issues with handling post taxonomies/terms as arrays - when there is a taxonomy with only one term. In my custom coding (which I can adapt - it's a mess honestly) as well as in the related-pages plugin, seen here: Maybe also elsewhere but this is what comes up on my page 🤔 |
I can't seem to replicate this error... I'm using the blog skeleton: https://getgrav.org/download/skeletons/blog-site/2.0.0 It has taxonomy plugin, as well as taxonomy with only one entry (such as
|
I guess the problem might be is your taxonomy has arrays further in where it shouldn't have. Can you give me a sample of the pages taxonomy that are causing the problems??? |
No further arrays that I'm aware of. To reproduce, pull vanilla Grav develop branch, replace the user folder by this user.zip and run bin/grav install for the dependencies. The error occurs on I honestly don't know why there is no issue with the skeleton, I tried it myself but didn't dive in deeper to force it there. |
it's probably that
I will look into it today, even though this is not formatted correctly, it should still be backwards compatible with stuff that worked in 1.5. |
Thanks a lot! 👍 And I'll look for ways to bulk update the formatting on my website. |
OK this should fix it once and for all! |
Thank you so much! I'll test it in the evening after work 👍 |
Tested it, works perfectly - thanks once again for your patience with this issue. I finally close it now. |
Hi there,
I just noticed that taxonomy terms formatted as integers stopped working with URL taxonomy filters. I reproduced this behaviour with Grav 1.6.3 and the vanilla develop branch.
Here's an example of what I mean: Consider a page with a YAML header containing a string and an integer term:
What happens is that a URL filter on the first works properly but a URL filter on the second fails to deliver a result. Before the latest release, both worked. (I linked my real-world example for reference).
Changing every integer term to string isn't an option for me as I have a huge amount of them. I already tried to strval every term automagically via plugin hook. It works locally, but not on production. I'll keep on tinkering around, but maybe there are more people out there having this issue.
Edit: Fixed typo
The text was updated successfully, but these errors were encountered: