Skip to content

Asset field with multiple entries in a matrix produces wrong values for element fields #1691

@tomfrit

Description

@tomfrit

Description

Wehn trying to import an asset field with multiple entries which is nested in a matrix field the element fields for each asset are populated wrong. Only the first occurence of the field value is used for every entry

Steps to reproduce

  1. Create an entry type with a matrix field. In this matrix field place an asset/image field
  2. import a JSON file with a structure like this:
[
	{
		"matrix": [
			{
				"images": [
					{ "url": "https:\/\/localhost\/image_1.jpg", "description": "Description for image 1" },
					{ "url": "https:\/\/localhost\/image_2.jpg", "description": "Description for image 2" },
					{ "url": "https:\/\/localhost\/image_3.jpg", "description": "Description for image 3" },
					{ "url": "https:\/\/localhost\/image_4.jpg", "description": "Description for image 4" },
				]
			}
		]
	}
]
  1. Map the data in feedme so url is the asset source and description is the alt text (under "element fields")

Result: While the assets are properly created, they all get the alt text "Description for image 1"

Additional info

  • Craft version: 5.8.18
  • PHP version: 8.3.21
  • Database driver & version:
  • Plugins & versions: Feedme 6.10.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions