locked
Failure when updating content type RRS feed

  • Question

  • I need to add a column to the Page site content type. I want this to push through to all libraries and all content types that inherit from Page (which is a few on our site).

    When I run it I get the following error:

    File Not Found.   at Microsoft.SharePoint.Library.SPRequestInternalClass.GetWebUrl(Guid gWebId, String bstrSiteUrl)
       at Microsoft.SharePoint.Library.SPRequest.GetWebUrl(Guid gWebId, String bstrSiteUrl)
       at Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId, Int32 mondoHint)
       at Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId)
       at Microsoft.SharePoint.SPContentType.PushDownChanges(CodeToPushDownChangesToDerivedCT derivedCTPushdownCode, CodeToPushDownChangesToListCTs listDerivedCTsPushdownCode, Boolean throwOnSealedOrReadOnly)
       at Microsoft.SharePoint.SPContentType.UpdateOnWeb(Boolean bPushdown, Boolean bThrowOnSealedOrReadOnly)
       at Microsoft.SharePoint.SPContentType.Update(Boolean updateChildren, Boolean throwOnSealedOrReadOnly)
       at Microsoft.SharePoint.SPContentType.Update(Boolean updateChildren)
       at Microsoft.SharePoint.ApplicationPages.AddFieldToContentTypePage.UpdateWeb()
       at Microsoft.SharePoint.ApplicationPages.AddFieldToContentTypePage.Update(Object o, EventArgs e)
       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    The content type itself, and those that inerhit from it get the new column, but none of the libraries down the tree get the fields added. The logs have nothing in it so I really have no idea what's failing. Anyone have any thoughts?


    • Edited by Stephen Hynds Thursday, June 16, 2011 9:55 AM spelling
    Thursday, June 16, 2011 9:53 AM

All replies

  • Hi Stephen,

    Content type does not contain a column, or field. It only contains a reference to a site column or field. Therefore you should create a site column before you can add it to the content type definition. The field reference in content type are managed through SPFieldLink object.

    Do this and then check the properties of list for Content Types.


    ------------------------------------ Happy Workaround :) Vivek

    http://www.linkedin.com/pub/vivek-mishra/11/456/a54

     

    • Proposed as answer by Rashu,Rahul Thursday, July 7, 2011 7:33 AM
    • Unproposed as answer by Stephen Hynds Thursday, July 7, 2011 8:40 AM
    Thursday, July 7, 2011 2:24 AM
  • Hi Vivek,

    I have tried creating a site column, then attaching it to the field. As I've said it adds the field to the content type but it does not cascade down to lists inheriting from the content type. It sits for a while looking like it's processing then fails with the error above.

    Thanks.

    Thursday, July 7, 2011 8:49 AM