Consider the following scenario:
- You create a Windows SharePoint Services 3.0 site collection.
- You export the site collection.
- You import the site collection into a new site collection.
- You create a new customized list in the new site collection.
- You add a new list item and then try to edit the newly-added list item.
In this scenario, you cannot edit the newly-added list item.
This problem was previously fixed in a hotfix package that is described in Microsoft Knowledge Base (KB) article 961175. After you install build 12.0.6336.5001 of the hotfix that is described in KB 961175, newly created SharePoint sites do not experience this problem as expected. However, existing SharePoint sites that already experienced this problem before you install the hotfix that is described in KB 961175 still have this problem. In this case, you have to run an object model code to work around this problem on existing sites.
To work around this problem in the list fields on existing sites, run the following object model code:
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;
}
To work around this problem in the Web fields on existing sites, run the following object model code:
void FixWebField()
{
string RenderXMLPattenAttribute = "RenderXMLUsingPattern"
string weburl = "http://localhost"
SPSite site = new SPSite(weburl);
SPWeb web = site.OpenWeb();
SPField f = web.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;
}
To work around this problem in the list template (.stp) on existing sites, follow these steps:
- Rename the .stp file to a .cab file.
- Open the Manifest.xml file that is included in the .cab file.
- Change the contents of the Manifest.xml file to the following:
<Field ID="{BA3C27EE-4791-4867-8821-FF99000BAC98}"
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;">
<FieldRefs>
<FieldRef ID="{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}" Name="ID"/>
</FieldRefs>
<DisplayPattern>
<CurrentRights/>
</DisplayPattern>
</Field>
- Repackage the updated Manifest.xml file into the .cab file.
- Rename the .cab file back to the .stp file.
- Upload the new list template (.stp) to the template gallery.
Note The lists that are created from this new list template should work as expected.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
961175
(http://support.microsoft.com/kb/961175/
)
Description of the Windows SharePoint Services 3.0 hotfix package (Sts.msp): December 19, 2008
Article ID: 971351 - Last Review: July 29, 2009 - Revision: 1.0
APPLIES TO
- Microsoft Office SharePoint Server 2007
| kbtshoot kbexpertiseinter kbsurveynew KB971351 |