1

When I'm trying to edit a display template, I'm getting the following error:

HtmlDesign:[Unexpected exception:ItemUpdated] for key[_catalogs/masterpage/Display Templates/search/Control_Compact.html] EventAfterUrl:_catalogs/masterpage/Display Templates/search/Control_Compact.html with exception message: System.ArgumentException: <nativehr>0x80070057</nativehr><nativestack></nativestack>Invalid data has been used to update the list item. The field you are trying to update may be read only.    
 at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bUnRestrictedUpdateInProgress, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)    
 at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bUnRestrictedUpdateInProgress, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)    
 at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion)    
 at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion)    
 at Microsoft.SharePoint.SPListItem.Update()    
 at Microsoft.SharePoint.Publishing.Design.AssociatedFile.SaveBinaryToNonEditableFile(MemoryStream nonEditableFileStream)    
 at Microsoft.SharePoint.Publishing.Design.DisplayTemplateDesignFile.GenerateStreamAndSaveToNonEditableFile()    
 at Microsoft.SharePoint.Publishing.Design.DisplayTemplateDesignFile.ConvertEditableFileToNonEditableFile()    
 at Microsoft.SharePoint.Publishing.Design.AssociatedFile.UpdateAssociatedItem(SPItemEventProperties properties)    
 at Microsoft.SharePoint.Publishing.Design.AssociatedFile.<OnItemUpdated>b__e(SPItemEventProperties properties)    
 at Microsoft.SharePoint.Publishing.Design.AssociatedFile.CallBaseEnsureAssociatedThenDoWork(SPItemEventProperties properties, Action`1 baseMethod, Action`1 action)    
 at Microsoft.SharePoint.Publishing.Design.HtmlDesignEventReceiver.<ItemUpdated>b__12(SPItemEventProperties properties, FileWithStatus fileWithStatus)    
 at Microsoft.SharePoint.Publishing.Design.HtmlDesignEventReceiver.RunOnlyIfFirstEvent(SPItemEventProperties properties, Action`2 action)

I tried to edit the display template via webdav and notepad.

If i'm trying to insert a new item or control display template the new item doesn't show in the display template selection of the search webpart.

Can anyone help me?

0

I ended up with restoring the entire Master Page Gallery from another sitecollection.

Steps:

  1. Backup an existing and working Master Page Gallery from another Site Collection (Central Administration/Backup and Restore/Export a site or list)
  2. Set "AllowDeletion" to true for the broken Master Page Gallery with Sharepoint Designer or Sharepoint Manager
  3. Delete the broken Gallery
  4. Restore the gallery from the backup created in step 1 using Import-SPWeb
  5. Moving the Master Page Gallery from the root of the Site Collection to the subfolder /_catalogs using Sharepoint Designer
  6. Correcting the permissions for the imported masterpage gallery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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