We encountered a problem which seemed really strange while Updating Title field of list to our publishing webs via Object model, power shell, Sharepoint designer but its not updated.
I tried some disassembling myself with telerik de-Compiler and found out that there is a very similar condition in SPList’s Title property’s setter and found that- "Some properties ARE NOT updated if the Thread’s UI Culture IS NOT the same as the web’s UI Culture".
[csharp]
public string Title
{
get
{
unsafe
{
if (CultureInfo.CurrentUICulture.LCID != this.Lists.Web.UICulture.LCID)
{
return this.TitleResource.Value;
}
object item = this.m_ListAttributesDict["NewListTitle"];
if (item != null)
{
return (string)item;
}
this.EnsurePropsFresh();
return (string)this.m_arrListProps[4, this.m_iRow];
}
}
set
{
unsafe
{
if (!SPUtility.StsCompareStrings(this.Title, value))
{
this.TitleResource.Value = value;
}
if (CultureInfo.CurrentUICulture.LCID == this.Lists.Web.UICulture.LCID)
{
this.m_arrListProps[4, this.m_iRow] = value;
this.m_ListAttributesDict["NewListTitle"] = value;
}
}
}
}
[/csharp]
you could handle the problems described above by changing the thread’s UI Culture to the web’s UI Culture programmatic-ally and then update the title.
All the very best!!!!!!!!!!!!
Subscribe to:
Post Comments
(
Atom
)
Thanks , nice article........
ReplyDeleteHuh..can't believe Microsoft did this..but nevertheless it is SharePoint, any UNEXPECTED can happen.
ReplyDelete