Issues with Search Results Page Layouts and SharePoint Designer

Share on facebook
Share on twitter
Share on linkedin

Description

An issue was encountered in a SharePoint 2013 environment, where when attempting to create a new Search Results page through the SharePoint UI, an error would be generated and the page creation was unsuccessful.

If an existing Search Results page was copied and pasted into the same Pages library through SharePoint Designer, there were no issues and no error generated.

The result is that new Search Results pages could not be created for custom Result Sources or other formatting / data sourcing needs.

Prerequisites to Reproduce the Issues

To recreate the issue, the following may be needed:

  • SharePoint Server 2013
  • A Publishing Portal site
  • An Enterprise Search Center site
  • SharePoint Designer 2013
  • Site Collection Administrator access

Steps to Reproduce the Issue

Below are steps and details around recreating the issue in a standard environment:

  1. After a Publishing Portal with an Enterprise Search Center has been created, open the top-level site with SharePoint Designer. Learn more about sharepoint governance here in terms of SharePoint Design.
  2. Within Site Objects, navigate to All Files, then _catalogs, then masterpage
  3. Check out the file SearchResults.aspx, and open to Edit File in Advance Mode
  4. Note that the and other Web Part tags have an element setting the __MarkupType to “vsattributemarkup”:
  5. Now edit the page in a non-destructive way, such as placing a CSS comment in the PlaceHolderAdditionalPageHead section:
  6. Save the file within SharePoint Designer, and close the file
  7. Within SharePoint Designer, reopen the file
  8. Note that the and other Web Part tags have the element of __MarkupType now set to “xmlmarkup”, instead of the original value of “vsattributemarkup”:
  9. Navigate to your Search Center site
  10. Navigate to the Pages library contained within the Search Center site
  11. Click File, New Document, and select Page  
  12. Provide a Test title, and URL Name
  13. Under Page Layout, choose “(Welcome Page) Search results”
  14. Click Create
  15. You should receive an error page such as the following:
  16. If the Correlation ID is investigated in the SharePoint ULS logs, an error like the following will be found:

06/20/2014 13:54:15.72 w3wp.exe (0x3730) 0x0B10 SharePoint Foundation Web Parts 7935 Information https://www..com/_catalogs/masterpage/SearchResults.aspx – An unexpected error has been encountered in this Web Part. Error: Unknown server tag., DesignText:

Workaround

The currently identified workaround involves resetting file versions on the respective Page Layout file, for instance SearchResults.aspx. This apparently forces SharePoint to interrogate the file, and reset the __MarkupType field value to “vsattributemarkup”.

  1. Navigate to the top-level site in the site collection, and click the Site Actions symbol, then Site Settings:
  2. Under Web Designer Galleries, click Master pages and page layouts  
  3. Find the Page Layout file, in this example it is SearchResults.aspx; Then click Version History:
  4. Note what the current version of the file is, that has the latest changes; In this example it is version 8.0:
  5. Choose a previous version of the file, it doesn’t really matter which, and click Restore
  6. Click OK on the prompt about replacing the current version
  7. Note that the latest file has been replaced with a new version, which contains old content:
  8. Now, on the file which contains the desired changes, click Restore; In this case it is version 8.0
  9. Click OK when prompted to replace
  10. There should now be an updated version that contains the desired changes:  
  11. Publish the version as a major version; In this case the version number increases to 9.0
  12. To verify the __MarkupType element value has been reset, open the file in SharePoint Designer
    • IMPORTANT: Do not save the file within SharePoint Designer again, only view
  13. Verify that the instances of __MarkupType have been reset to contain the value of “vsattributemarkup”:
  14. As final verification, try creating a new Search Results page as outlined in the previous section; The steps to create a new Search Results page should now be successful, and not generate any errors
    • Note: Test both creating the new results page, as well as opening it in the browser

Additional Details

This issue was found in a client’s environment who was using the following build version of SharePoint 2013:

062314_1435_IssueswithS19.png

It also appears others have encountered this issue with previous versions of SharePoint:

More to explore