Data is getting lost after saving composite multifield content fragments | Community
Skip to main content
Level 3
January 2, 2024

Data is getting lost after saving composite multifield content fragments

  • January 2, 2024
  • 2 replies
  • 1047 views

Hi,

 

Data is getting lost after saving composite multifield content fragments

 

when we save the composite multifield the data is getting stored in JSON object and after some time if we open the content fragment the data is lost. If we go to crxde and check on the node the value was stored in a string array and the previous JSON object stored was deleted.

 

we have written the custom JS with the help of the below link

 

https://experience-aem.blogspot.com/2023/06/aem-cloud-service-multiple-composite-multifields-in-content-fragment-editor.html

 

 

Please help me on the same what might the issue. 

 

Thanks & Regards,

Kalyan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

AsifChowdhury
Community Advisor
Community Advisor
January 3, 2024

Hi @kalyanchakravarthych 

I have faced this issue with multifield. When the multifield is storing data as an array in CRX it cannot retrieve as like as we have submitted the data. When add multifield item, we are adding the items as like a node. So when retrieve the data it should be as like as node. But in CRX it's storing like an array that's why it's cannot retrieve the data.

 

If the saved multifield data is look like this then the multifield can retrieve the data correctly.

 

 

Thanks

Level 3
January 3, 2024

Hi @asifchowdhury ,


we are using the old approach as the data will get stored as a JSON. This issue is not occurring frequently. Sometimes only this issue occurring still we couldnot replicate the issue in our local. Only higher environments we are facing this issue sometimes. Not able to get when the issue is occurring and what might be causing this issue. Please help me is there any workaround for this time being 

 

 

Thanks & Regards,

Kalyan

January 29, 2025

Hi @kalyanchakravarthych,

we had same issue in one of the environment and was able to identify one scenario is when we save the CF and if you don't close the window then every 10 mins autosave event is triggering and after sometime it is sending empty key value pairs to save.

To stop the autosave event I have added below piece of code to return the autosave event in requestsave method of custom JS code.

 

function requestSave(callback, options) {
if(options.type === "autosave"){
return;
}
-----
-----
-----
}

Thanks,
Vishnu.

Level 2
January 29, 2025

Thank you @vt587