Skip to main content
deleted 69 characters in body; edited tags
Source Link
Atila Sos
  • 6.3k
  • 2
  • 16
  • 26

I have a function that localizes a componentComponent (if needed) before updating it'sits content. I'm randomly getting errors when, after this call, I try to update the content, getting a 'It is not possible to check-out a shared item' error. Taking a look at the logs, I see that component was not localized. The only reason is because this 'item.BluePrintInfo.IsLocalized'item.BluePrintInfo.IsLocalized is lying.

hereHere my code...

```
  
ComponentData item = (ComponentData)client.Read(tridionItemUri.ToString(), new ReadOptions());
                if (!(bool)item.BluePrintInfo.IsLocalized)
                {

                    client.Localize(tridionItemUri.ToString(), new ReadOptions());
                    Logger.Info(new TridionItemLog() { Message = "Component localized", Tcm = tridionItemUri.ToString() }.ToString());
            }
    }
```

If I go to SDL Web and manually localize the componentComponent, then I can update with no problem.

So my question is. Could this BluePrintInfoBluePrintInfo be cached or not realtime info? Should I use another way to check whether my componentComponent is localized?

Thanks in advance.

BTW: It's SDL Web 8.5 SP1

I have a function that localizes a component (if needed) before updating it's content. I'm randomly getting errors when, after this call, I try to update the content, getting a 'It is not possible to check-out a shared item' error. Taking a look at the logs, I see that component was not localized. The only reason is because this 'item.BluePrintInfo.IsLocalized' is lying.

here my code...


 ComponentData item = (ComponentData)client.Read(tridionItemUri.ToString(), new ReadOptions());
                if (!(bool)item.BluePrintInfo.IsLocalized)
                {

                    client.Localize(tridionItemUri.ToString(), new ReadOptions());
                    Logger.Info(new TridionItemLog() { Message = "Component localized", Tcm = tridionItemUri.ToString() }.ToString());
                }

If I go to SDL Web and manually localize the component, then I can update with no problem.

So my question is. Could this BluePrintInfo be cached or not realtime info? Should I use another way to check whether my component is localized?

Thanks in advance.

BTW: It's SDL Web 8.5 SP1

I have a function that localizes a Component (if needed) before updating its content. I'm randomly getting errors when, after this call, I try to update the content, getting a 'It is not possible to check-out a shared item' error. Taking a look at the logs, I see that component was not localized. The only reason is because this item.BluePrintInfo.IsLocalized is lying.

Here my code...

```
 
ComponentData item = (ComponentData)client.Read(tridionItemUri.ToString(), new ReadOptions());
    if (!(bool)item.BluePrintInfo.IsLocalized)
    {

        client.Localize(tridionItemUri.ToString(), new ReadOptions());
        Logger.Info(new TridionItemLog() { Message = "Component localized", Tcm = tridionItemUri.ToString() }.ToString());
    }
    
```

If I go to SDL Web and manually localize the Component, then I can update with no problem.

So my question is. Could this BluePrintInfo be cached or not realtime info? Should I use another way to check whether my Component is localized?

Thanks in advance.

BTW: It's SDL Web 8.5 SP1

Source Link

IsLocalized randomly failing

I have a function that localizes a component (if needed) before updating it's content. I'm randomly getting errors when, after this call, I try to update the content, getting a 'It is not possible to check-out a shared item' error. Taking a look at the logs, I see that component was not localized. The only reason is because this 'item.BluePrintInfo.IsLocalized' is lying.

here my code...


 ComponentData item = (ComponentData)client.Read(tridionItemUri.ToString(), new ReadOptions());
                if (!(bool)item.BluePrintInfo.IsLocalized)
                {

                    client.Localize(tridionItemUri.ToString(), new ReadOptions());
                    Logger.Info(new TridionItemLog() { Message = "Component localized", Tcm = tridionItemUri.ToString() }.ToString());
                }

If I go to SDL Web and manually localize the component, then I can update with no problem.

So my question is. Could this BluePrintInfo be cached or not realtime info? Should I use another way to check whether my component is localized?

Thanks in advance.

BTW: It's SDL Web 8.5 SP1