What happened?
Description
When duplicating the same Asset field (giving different handles) to use on the same entry type. The querying with the eager loading function gives the content of the first original field.
{% set logo = featured ? entry.thumbnail.eagerly().one() : entry.logo.eagerly().one() %}
{% set grid = entry.grid.eagerly().one %}
The query above always returns contents of entry.logo for both logo and grid even for entry.thumbnail if featured is true, and I think this field was first assigned to the entry type, or maybe it's just first in the field layout.
Steps to reproduce
- Assigng same Asset field multiple times to an entry type (it will assign diff handles automatically)
- Populate asset field with content
- Query these asset fields in template using
eagerly()
Expected behavior
To return proper content for each field with different field handle using eagerly()
Actual behavior
Returns the content of first Asset field in the filed layout for all other duplicates of this field.
Craft CMS version
5.4.7.1
PHP version
8.3
Operating system and version
ddev
Database type and version
postgres 14
Image driver and version
What happened?
Description
When duplicating the same Asset field (giving different handles) to use on the same entry type. The querying with the eager loading function gives the content of the first original field.
The query above always returns contents of
entry.logofor bothlogoandgrideven forentry.thumbnailif featured is true, and I think this field was first assigned to the entry type, or maybe it's just first in the field layout.Steps to reproduce
eagerly()Expected behavior
To return proper content for each field with different field handle using
eagerly()Actual behavior
Returns the content of first Asset field in the filed layout for all other duplicates of this field.
Craft CMS version
5.4.7.1
PHP version
8.3
Operating system and version
ddev
Database type and version
postgres 14
Image driver and version