0

Scenario: While working with a Publishing Page, when I edit the page, edit the properties, and then try to save or check-in. I get the following error.

Error Log:

Application error when access /Pages/150th-Anniversary-Web-Site-is-Now-Live.aspx, Error=Object reference not set to an instance of an object.
at Microsoft.SharePoint.WebControls.BaseChoiceField.Validate()
at System.Web.UI.Page.Validate()
at Microsoft.SharePoint.WebControls.SPPageStateControl.EnsureItemSavedIfEditMode(Boolean forceSave, String overwriteCommandHandler, String discardChangesCommandHandler)
at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageStateControl.SaveAndRouteIfNecessary(String eventArgument, PublishingPage& currentPage, Boolean saveOnly, Boolean& wasRouted)
at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageCheckinHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.WebControls.BaseChoiceField.Validate()
at System.Web.UI.Page.Validate()
at Microsoft.SharePoint.WebControls.SPPageStateControl.EnsureItemSavedIfEditMode(Boolean forceSave, String overwriteCommandHandler, String discardChangesCommandHandler)
at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageStateControl.SaveAndRouteIfNecessary(String eventArgument, PublishingPage& currentPage, Boolean saveOnly, Boolean& wasRouted)
at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageCheckinHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Failed to get document content data. System.ComponentModel.Win32Exception (0x80004005): Cannot complete this function at Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 rowOrd, Object ospFileStmMgr, SPDocumentBindRequest& dbreq, SPDocumentBindResults& dbres)

1 Answer 1

1

Seems like there is a field that is required--looks to be a choice column, maybe in the properties of that webpart page. It could be custom code. In code, make sure you check for null, especially whenever you are trying to grab a value of a column.

item["columnname"].toString() //throws an error whenever that column is empty
1
  • Thank you for pointing that out Mike. I had made a HTML Page Layout which was working fine. I then needed to rebuild this dev farm. After that i re-imported my Page Layout. Somehow, even though the HTML referenced the content type fields, they were now missing from the page in the UI view. You were correct. Required fields were not getting filled out. I went back to the snippet gallery, re-copied the field code, put that code into my HTML Page Layout. Issue resolved.
    – schuess
    Commented Jul 20, 2015 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.