Closed MattWilcox closed 4 years ago
What exactly are navigation
and navigationFooter
in your code?
{% set
navItems = navigation.navigationFooter.with([
'internalPage:page',
'file:file'
]).all()
%}
navigation
is a Global group, and navigationFooter
is a Matrix field.
Ok so it seems that the element query used to detect eager-loading opportunities is being executed here as well. If you want to eliminate the warning then you will probably need to eager-load the global set first.
{% set navigation = craft.globalSets().handle('navigation').with([
'navigationFooter.internalPage:page',
'navigationFooter.file:file',
]).one() %}
Ok, so use that rather than my existing Eager Loading of navItems... I'll try and wrap my head around that, cheers.
I'm not saying it's the right way (or even recommended way), but it should eliminate that recommendation if that's what you're after :)
Unsure if this is a genuine issue or something I just aren't understanding.
Blitz Recommendations is flagging a field which is loaded from a Global as not being Eager loaded, when... pretty sure it is.
But here's the code pertaining to that field in the template: