Matrix field data replaced #880
Replies: 8 comments
-
That's correct behaviour, as with any field in Craft, it doesn't get appended to existing values. When you edit an entry traditionally through the control panel, you've got existing blocks there, you add, remove, rearrange to your liking, then save. That save overwrites the entire Matrix field with what's in the entry. We'll look at adding a flag to manage this (append/prepend/replace). |
Beta Was this translation helpful? Give feedback.
-
That would be great if the option was there, it would be epic! Do you mean put a flag in possibly like a while from now or maybe look at doing that soon? |
Beta Was this translation helpful? Give feedback.
-
We'll have to add something to handle this, but will be in the next few beta versions. |
Beta Was this translation helpful? Give feedback.
-
Thank you! This will be good, really appreciate how proactive you and the team are :) |
Beta Was this translation helpful? Give feedback.
-
We ran into this issue today, it isn't clear from the import screen that this will happen as with all fields other than matrix when you select 'don't import' it leaves those values alone, but because the matrix get's re-created, you lose all the values you had in the other fields of your matrix. To make matrix consistent with the other fields, it would be good if leaving it to 'don't import' that it got the values from the block you are about to drop, so that they remain in the new one, and be able to set a default value incase you did just want to clear those values. |
Beta Was this translation helpful? Give feedback.
-
I can see how that's confusing, but it does in fact work just like other fields - in that their content is replaced by what you're importing. Its just that unlike normal fields, Matrix can have multiple bits of content. It would be similar to importing into an entries field and appending onto any existing values. We'll add better handling of this soon - its actually a little trickier than we'd planned (deserialising field content), which is the cause for delays. |
Beta Was this translation helpful? Give feedback.
-
The Matrix field is updated even if the import data is identical – is this related to the above issue(s) or should I open a new issue? |
Beta Was this translation helpful? Give feedback.
-
@membla Probably best to open a new issue to track that. This feature request is specifically for allowing either appending or replacing content. Matrix content shouldn't be updated if the data is the same. |
Beta Was this translation helpful? Give feedback.
-
Description
When I import using JSON with FeedMe Pro and need to import more records into an entry that has a Matrix field. I find it deletes the previous and adds the new data only. Is there anyway to append to the Matrix field leaving the previous data intact?
Additional info
Beta Was this translation helpful? Give feedback.
All reactions