Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Have you tried debugging, and checking the content of batch
just before calling _contentRepository.Publish(batch);
?
Yes, the content is okay. And actually if I revert to last published version then I get everything updated. So the problem is exactly in creating two instances (published and draft) for each language branch.
By the way, if I update the language instances one by one contentRepository.Save(updatedContent, SaveAction.Publish, AccessLevel.NoAccess)
I get the same issue. So this is not about batch only.
@Alex did you get to the bottom of this issue? I'm facing the same issue at the moment.
Hi
When trying to create a commerce content programmatically using code similar to this
var clone = content.CreateWritableClone<CustomProduct>(); //Update clone properties here var batch = new List<CustomProduct> { clone }; foreach (var branch in customModel.LanguageVersions) { var branchContent = contentRepository.Get<CustomProduct>(contentLink, branch.CultureInfo).CreateWritableClone<CustomProduct>(); //update branchContent batch.Add(updatedContent); } _contentRepository.Publish(batch);
I get *two* versions of my content instances for each language except the main one.
One of them is in published state and created by "you", the other one is in a draft and created by "system".
Did anybody face the issue?
PS Tried to post a screenshot here. "Only users belong to partner companies are able to upload image files." - a bit annoying, isn't it?