SharePoint Modified column not updated
In all the document libraries under a specific site collection (MOSS 2007), the column [Modified] is not being updated when a document is modified. The only thing that triggers the update of the [Modified] column is a check-out. Other site collections under the same webapplication are not affected. When version history is configured, if you look at the version history from IE, all the latest versions are shown with the same date and time. But If you open the document in word 2007 and look a the version history from word, the right time and date are shown. I also can see the right date of the versions when using SharePoint Manager (SPM) from codeplex. I looked at the [Modified] column schema with SPM, and it all appears to be correct. This seems to have all started when someone went to the following page and clicked ok....https://sitecollectionurl/_layouts/fldedit.aspx?field=Modified Any help would be appreciated. thanks Serge
May 3rd, 2010 8:38pm

Hi Serge, I once saw some similar issue caused by the corrupted column schema from our internal cases. Could you please check the schema of Modified column in SPM and compare the working one with the corrupted column? In my SharePoint farm, the working one’s sample schema is as follows, you could see the FromBaseType is set to "TRUE". <?xml version="1.0" encoding="utf-16"?> <Field ID="{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}" ColName="tp_Modified" RowOrdinal="0" ReadOnly="TRUE" Type="DateTime" Name="Modified" DisplayName="Modified" StorageTZ="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Modified" FromBaseType="TRUE" /> If there is no FromBaseType set in corrupted column schema, you could try to use the following code sample to fix the issue, please be advised to backup your site collection first. using System; using System.Collections.Generic; using System.Text; using Microsoft.SharePoint; using System.Xml; using System.IO; namespace ModifyFieldSchema { class Program { static void Main(string[] args) { using (SPSite msite = new SPSite("http://yoursitecollection")) { foreach (SPWeb mweb in msite.AllWebs) { for (int i = 0; i < mweb.Lists.Count; i++) { SPList mlist = mweb.Lists[i]; SPField mfield = mlist.Fields[new Guid("28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f")]; //Console.WriteLine(mlist.Title + " " + mfield.Title + " " + mfield.FromBaseType); if (mfield.FromBaseType != true) { XmlTextReader xmlReader = new XmlTextReader(new StringReader(mfield.SchemaXml)); XmlDocument xmlDocument = new XmlDocument(); XmlNode xmlNode = xmlDocument.ReadNode(xmlReader); xmlNode.Attributes["Hidden"].Value = "FALSE"; XmlAttribute fromBaseType = xmlDocument.CreateAttribute("FromBaseType"); fromBaseType.Value = "TRUE"; xmlNode.Attributes.Append(fromBaseType); //Console.WriteLine(xmlNode.OuterXml); mfield.SchemaXml = xmlNode.OuterXml; mfield.Update(); } } } } } } } Let me know the result if possible. Lambert Qin TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com Sincerely, Lambert Qin Posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
May 4th, 2010 6:38am

Thanks, the FormBase Type="true" partially fixed the problem... From now on when the document is modified, the date is also modified. But when I look at the version history from the browser, the versions that were modified while the schema was corrupted are not updated...See version 0.9-0.10-0.11-0.12 in the table below. If I open the document with word and look at the version history from word, the correct dates (different from the dates shown in the browser) are shown for version 0.9-0.10-0.11-0.12. 0.13 2010-05-05 11:50 0.12 2010-03-29 08:24 0.11 2010-03-29 08:24 0.10 2010-03-29 08:24 0.9 2010-03-29 08:24 0.8 2010-03-29 08:23 0.7 2010-03-28 13:56 Thanks Serge
May 5th, 2010 7:01pm

Hi Serge, I tried to capture the network traffic and find that Word use web service to get the version history in SharePoint: Here is the soap request and result for your information: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetVersions xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <fileName>Personal Documents/Test.docx</fileName> </GetVersions> </soap:Body> </soap:Envelope> <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <GetVersionsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <GetVersionsResult> <results xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <list id="{4E528230-D6F0-461B-A181-9164106A6F21}" /> <versioning enabled="1" /> <settings url="http://mysite/_layouts/LstSetng.aspx?List={4E528230-D6F0-461B-A181-9164106A6F21}" /> <result version="@1.1" url="http://mysite/Personal Documents/Test.docx" created="5/6/2010 2:49 AM" createdBy="CONTOSO\administrator" size="15648" comments="" /> <result version="1.0" url="http://mysite/_vti_history/512/Personal Documents/Test.docx" created="5/6/2010 2:49 AM" createdBy="CONTOSO\administrator" size="15648" comments="" /> </results> </GetVersionsResult> </GetVersionsResponse> </soap:Body> </soap:Envelope> In SharePoint Web UI, the version history shown in _layouts/Versions.aspx use OM to retrieve the data. From your description, the two data is different and the result returned from web service is correct, therefore, a possible solution is to using SharePoint OM to update the Modified Date according to the Modified date returned from web service. I am afraid I do not have a code sample for you, you may need to write it by yourself. And I am could help you to confirm the issue as I could not reproduce your issue in my local. If the issue was wildly affected your production farm, I suggest you to contact CSS via telephone. Or please backup your farm first before apply any code soutions. Hope the information can be helpful. Lambert Qin TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com Sincerely, Lambert Qin Posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
May 6th, 2010 3:09pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics