I'm seeing the below error when trying to update a components content field.
This item is localized
I have the following code which strips out the content, calls off to a couple of methods that updates the content source xml to that of replacedContentSource
. I only get an error when trying to localize the component. The reason I am having to do this is because the component content source contains component links linking to a publication not in the content master.
public void LocalizeAndAddComponentLinks(CoreServiceClient client, ComponentData component,
string source)
{
string contentSource = Tridion.CreateRelatedComponents(client, source);
string replacedContentSource = Tridion.GenerateTcmIds(contentSource);
component.Content = replacedContentSource;
client.Localize(component.Id, new ReadOptions());
client.Update(component, new ReadOptions());
}
I just don't understand why I'm getting this error, the component isn't localized and I've verified this by checking in Tridion.
component.Id
. You'll indeed need to specify where you want to localize the component. Change the Publication ID of that URI to the publication you want to localize into and you should be good to go.