How many times have we seen this in SharePoint 2013!
I was working on custom search results page that had custom display templates. These display templates weren't complex and were almost similar to OOB templates.
Everything seemed fine, I was getting results based on my query and managed metadata settings. All looked well until users started hitting these search pages. They were greeted with the message "Sorry, something went wrong". Search refiners in the page was working fine but not the results webpart.
I had no clue what was going wrong. I tried ULS logs and found access denied error on the .js file that gets created part of the display template while logging in to the site as an end user with read access. I saw similar error in fidler while logging in to the site as an end user. Here are the errors I found using fiddler and IE dev toolbar:
"file was blocked due to mime type mismatch"
"Access denied. Item does not exist. It may have been deleted by another user"
The fact that users with administrator privilege could view search results without this error made me think about the custom results page being not published properly. I double checked and triple checked but the page was checked in and published.
I did remember that I had similar issues working with custom master pages with previous versions of SharePoint. With not much hope I navigated to the folder in master page gallery where SharePoint stores display templates through browser and published the .html file of my custom display template. That did the trick and now users could view search results.
That was strange because the file was not in unpublished state and still we had to publish it once!
I was working on custom search results page that had custom display templates. These display templates weren't complex and were almost similar to OOB templates.
Everything seemed fine, I was getting results based on my query and managed metadata settings. All looked well until users started hitting these search pages. They were greeted with the message "Sorry, something went wrong". Search refiners in the page was working fine but not the results webpart.
I had no clue what was going wrong. I tried ULS logs and found access denied error on the .js file that gets created part of the display template while logging in to the site as an end user with read access. I saw similar error in fidler while logging in to the site as an end user. Here are the errors I found using fiddler and IE dev toolbar:
"file was blocked due to mime type mismatch"
"Access denied. Item does not exist. It may have been deleted by another user"
The fact that users with administrator privilege could view search results without this error made me think about the custom results page being not published properly. I double checked and triple checked but the page was checked in and published.
I did remember that I had similar issues working with custom master pages with previous versions of SharePoint. With not much hope I navigated to the folder in master page gallery where SharePoint stores display templates through browser and published the .html file of my custom display template. That did the trick and now users could view search results.
That was strange because the file was not in unpublished state and still we had to publish it once!
Comments