Describe the bug
During import the mapping of Original content Id to newly created content ID is not applied for Media and Relations. When content on Import side was created with different Id and mapping is done through idField
As it seems, it is possible, the any-relation content type items could be created with different ids (lets say 1, 2) (very common for my use case). In that case I have noticed there is mapping of original ID to new ID, but it is not applied correctly in all cases.
Content mapping is
is applied for components of currently processed item
is applied for zones of currently processed item
is NOT applied for media (the code is missing in SetComponents or anywhere else for V2)
is NOT applied for relations (the code is missing in SetComponents or anywhere else for V2)
leading to partial import and error message :
ValidationError: 1 relation(s) of type api:any-relation:any-relation associated with this entity do not exist
Expected behaviorYour-content-type should respect mapping to new values
Additional context
It seems all code is there, it is just not used.
the mapping is done in setComponents() function, but relations and media are ignored. There is also getComponents() function which is called only in setComponents() and it looks like it is made for this mapping, but it is called for zones and components only.
Describe the bug During import the mapping of Original content Id to newly created content ID is not applied for Media and Relations. When content on Import side was created with different Id and mapping is done through
idField
To Reproduce
lets have export file with relation or media:
As it seems, it is possible, the
any-relation
content type items could be created with different ids (lets say 1, 2) (very common for my use case). In that case I have noticed there is mapping of original ID to new ID, but it is not applied correctly in all cases.Content mapping is
The relation content type will be saved as:
But the
Your-content-type
will try to update these values:leading to partial import and error message :
ValidationError: 1 relation(s) of type api:any-relation:any-relation associated with this entity do not exist
Expected behavior
Your-content-type
should respect mapping to new valuesAdditional context It seems all code is there, it is just not used. the mapping is done in
setComponents()
function, but relations and media are ignored. There is alsogetComponents()
function which is called only insetComponents()
and it looks like it is made for this mapping, but it is called for zones and components only.Question #147 seems to be related