This is one of those errors that you spend a lot of time troubleshooting without a clue of why this is happening. As an experienced MOSS developer, you probably assume this is a permission issue; With this assumption, you use farm administrator account to log into the site, still you get access denied error page. You tried so many other steps, all to no avail. There is a good news and a bad news. Which one will you like me to talk about first? Just kidding!
Ok. The Good news is that you did not create or cause this issue. The bad news is that it is a bug. I’ve called and discussed this with the folks at Microsoft. There are two ways to fix this. Use step 1 to fix this issue in existing document libraries. Use step 2 to fix it in existing list templates
Step 1. For existing lists, you can run the following code to fix it. This here is a sample peace of code that should add the appropriate attribute to the list having the issue:
void FixField()
{
string RenderXMLPattenAttribute = “RenderXMLUsingPattern”
string weburl = “<http://localhost>”
string listName = “test2″
SPSite site = new SPSite(weburl);
SPWeb web = site.OpenWeb();
SPList list = web.Lists[listName];
SPField f = list.Fields.GetFieldByInternalName(“PermMask”);
string s = f.SchemaXml;
Console.WriteLine(“schemaXml before: ” + s);
XmlDocument xd = new XmlDocument();
xd.LoadXml(s);
XmlElement xe = xd.DocumentElement;
if (xe.Attributes[RenderXMLPattenAttribute] == null)
{
XmlAttribute attr = xd.CreateAttribute(RenderXMLPattenAttribute);
attr.Value = “TRUE”
xe.Attributes.Append(attr);
}
string strXml = xe.OuterXml;
Console.WriteLine(“schemaXml after: ” + strXml);
f.SchemaXml = strXml;
}
Name=”PermMask”
SourceID=”http://schemas.microsoft.com/sharepoint/v3“
StaticName=”PermMask”
RenderXMLUsingPattern=”TRUE”
Group=”_Hidden”
ReadOnly=”TRUE”
Hidden=”TRUE”
ShowInFileDlg=”FALSE”
Type=”Computed”
DisplayName=”$Resources:core,Effective_Perm_Mask;”>
Then repackage the manifest.xml file to a .cab file and rename it back to .stp. Upload the list template to the template gallery. Any subsequent lists created with this template should work as expected.
Microsoft promised to fix this in the next hotfix. Please note that to prevent new list templates from having this problem, you will need to update the fieldswss.xml via the next Hotfix. Please do not update fieldswss.xml manually.
Hello,
ReplyDeleteI know this is an old post but I'm running into the issue described here and would greatly appreciate any help you can give.
I've seen several articles discuss the solutions you describe above. I would like to use 'Step 2' to fix the .stp files but I have no idea how to find the .stp file. Can you please tell me where the .stp file is or give step by step instructions on how to solve this issue?
Thank you,
Toby