I'm getting a deprecation error from not using .all()
to query my elements:
Looping through element queries directly has been deprecated. Use the all() function to fetch the query results before looping over them.
This is usually very easy to fix because Craft normally tells you which template and line to add the .all()
to. However, when looking at the origin, I see:
/Users/Me/Sites/Project/vendor/twig/twig/lib/Twig/Extension/Core.php:577
This is pointing to something in Twig's vendor library, which I obviously don't want to fix for updating reasons. Does anyone know what this is referring to in my templates?
.all()
added. The error doesn't appear on all pages though, and I can't figure out what's different between the templates to cause the error in some instances but not others.ElementQueries
are not executed otherwise the error would not appear. You can edit the source code and instead of creating a deprecated error you dump the Query so you can see what things are searched. Or you post your Twig so we can search for it. Besides that I don't know how we are supposed to help. It's like fishing without watertwig_array_merge
function so likely you are trying to|merge
aQuery