- Issue created by @longwave
Discovered when debugging 🐛 Migrating images into custom fields can result in corrupted data Active
TypedDataManager stores prototypes of each object so it can clone them instead of creating them each time.
However for list objects the delta is included in the key, so in my example linked where I have a custom field containing four items I end up with these prototypes:
entity:node:article:field_image_and_text.0:heading
entity:node:article:field_image_and_text.0:subtitle
entity:node:article:field_image_and_text.0:text
entity:node:article:field_image_and_text.0:image
entity:node:article:field_image_and_text.1:heading
entity:node:article:field_image_and_text.1:subtitle
entity:node:article:field_image_and_text.1:text
entity:node:article:field_image_and_text.1:image
entity:node:article:field_image_and_text.2:heading
entity:node:article:field_image_and_text.2:subtitle
entity:node:article:field_image_and_text.2:text
entity:node:article:field_image_and_text.2:image
entity:node:article:field_image_and_text.3:heading
entity:node:article:field_image_and_text.3:subtitle
entity:node:article:field_image_and_text.3:text
entity:node:article:field_image_and_text.3:image
Why is the delta included in the key? This is most obvious here where custom has multiple properties but would appear to be the same for other multi-value fields - but I think the prototype item should be the same for each delta?
Remove the delta from the list key, ie. only store these prototypes
entity:node:article:field_image_and_text:heading
entity:node:article:field_image_and_text:subtitle
entity:node:article:field_image_and_text:text
entity:node:article:field_image_and_text:image
Active
11.0 🔥
typed data system