-
Notifications
You must be signed in to change notification settings - Fork 641
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
Eager loading broken on assets and entry fields within matrix blocks #3644
Comments
We are experiencing exactly the same issue with eager loading an image asset in a matrix block. Instead of returning |
Fixed for the next release. You can patch your installs in the meantime by editing composer.json: "require": {
"craftcms/cms": "dev-develop#f738158f3f264e5cbd48656338f7661c151408d1 as 3.1.0",
"...": "..."
} And then run |
I still get this exact issue, has it been reintroduced? |
@JshGrn Not to our knowledge… can you provide your Craft version, and exactly what you’re seeing? |
If I do a .with on a matrix field eager loading the asset field it returns an empty array. I was able to work around it by doing a asset query withTransforms and then relatedTo the matrix field. |
@JshGrn There is a special syntax for eager-loading fields nested within Matrix fields – see Eager-Loading Elements Related to Matrix Blocks. |
Entry and asset fields within a matrix block return an empty array when eager loading after updating to 3.1
The following code generates the error "Key "0" does not exist as the array is empty". Prior to updating to 3.1 this was working ok:
(site is a Global Set, logos is a matrix field which has one 'logo' block type)
If I change the code to this the code works:
The text was updated successfully, but these errors were encountered: