What happened?
Description
The following code will cause the error:
{% set addresses = craft.addresses.with(['owner']).all() %}
This is due to
|
'elementType' => get_class(reset($sourceElements)), |
expecting that the element type for the eager loading of the parent is the same element type as the source element.
Adding a matrix field to a category element and using this query can also cause the error:
{% set matrix = craft.entries.with(['owner']).all() %}
Since the category is not an entry element type.
Steps to reproduce
Add this code to a front-end template:
{% set addresses = craft.addresses.with(['owner']).all() %}
Actual behavior
PHP error
Related issue:
craftcms/commerce#3817
Fixed manually in Commerce with:
craftcms/commerce@5eacab1
Craft CMS version
5.x
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
What happened?
Description
The following code will cause the error:
{% set addresses = craft.addresses.with(['owner']).all() %}This is due to
cms/src/base/NestedElementTrait.php
Line 42 in 92440e9
expecting that the element type for the eager loading of the parent is the same element type as the source element.
Adding a matrix field to a category element and using this query can also cause the error:
{% set matrix = craft.entries.with(['owner']).all() %}Since the category is not an entry element type.
Steps to reproduce
Add this code to a front-end template:
{% set addresses = craft.addresses.with(['owner']).all() %}
Actual behavior
PHP error
Related issue:
craftcms/commerce#3817
Fixed manually in Commerce with:
craftcms/commerce@5eacab1
Craft CMS version
5.x
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response