Errors Sitecore Fix

Sitecore 7.1 Media Library Search Browser in SPEAK Does Not Show Files When Using Solr

Seems like the Sitecore Solr search configuration and providers are still in their toddler stages. There are a few quirks, however, Sitecore is working hard to fix them. The following article describes one of the issues that I have discovered recently, while setting up a Solr solution for a client. The problem was related to the Web API DateTime calls and the new Media Library SPEAK browsing client interface. The article provides a fix package, which you want to keep handy, as there is no ETA on the fix being included in the Sitecore build yet.

Problem: Files not Showing up in Search Media Library SPEAK View

Sitecore Media Library No Items Found

Sitecore Media Library No Items Found

After following the steps outlined in the Sitecore Search Scaling Guide to setup Solr on my local development environment everything seemed to work fine, besides the Image field Browse button. Sitecore 7.1 has introduced a new SPEAK dialog for browsing assets in the Media Library using search (Sitecore is undergoing a face lift, slowly retiring the Sheer UI with more conventional HTML SPEAK framework). The new dialog now displays media assets using the search view, with an option to switch to the conventional structured view.

The problem we have encountered was that none of the assets were found when the Browse button was clicked, and we were forced to switch to the conventional hierarchical view to find the uploaded media files. In Sitecore logs I have also noticed the following error come up every time the Browse button was hit on an image field (other fields with the same functionality may have been affected as well):

 

ERROR [Item Web API] String was not recognized as a valid DateTime.
Exception: System.FormatException
Message: String was not recognized as a valid DateTime.
Source: mscorlib
   at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at Sitecore.ItemWebApi.Facets.UpdatedFacetProvider.GetFacetValue(String value)
   at Sitecore.ItemWebApi.Pipelines.Request.Search.GetFacets(IList`1 facetProviders, FacetResults facets)
   at Sitecore.ItemWebApi.Pipelines.Request.Search.RunSearchPipeline(RequestArgs args, String searchText, String languageName)
   at Sitecore.ItemWebApi.Pipelines.Request.Search.Process(RequestArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.ItemWebApi.Pipelines.HttpRequest.LaunchRequest.Process(HttpRequestArgs arguments)

How to Fix the Media Library Browser Issue with Solr.

Sitecore Media Library No Items Found Fixed

Sitecore Media Library No Items Found Fixed

After some time of digging through the search dlls with a reflector, the root of the issue seemed to be located in the Item Web API libraries. I have contacted the Sitecore Support and they were very quick to recognize the bug and provide the solution. Unfortunately, as usually, there is no ETA on the fix being included in the Sitecore build, until then the fix below should do the trick.

After a few tweaks, I have created a packaged fix. To resolve the Media Library Browse button issue please follow these steps:

  1. Download the Media Library Browser Fix for Solr Package
  2. Install the package using the Sitecore Installation Wizard.
  3. Rebuild all search indexes

After following the steps above, the Media Library SPEAK search browser should display the media items and the Web API errors should go away as well.

Hopefully this saved you hours of research. Happy coding!

 

 


3 comments on “Sitecore 7.1 Media Library Search Browser in SPEAK Does Not Show Files When Using Solr
  1. Hi Vasiliy,
    I installed the above package but now I am getting a different error shown below. Any idea as to why this is happening?

    8396 14:37:52 ERROR [Item Web API] Method not found: ‘Void Sitecore.ItemWebApi.Pipelines.Search.SearchArgs..ctor(Sitecore.ContentSearch.IProviderSearchContext, Sitecore.Data.Items.Item, Sitecore.Data.Items.Item, System.String, System.String)’.
    Exception: System.MissingMethodException
    Message: Method not found: ‘Void Sitecore.ItemWebApi.Pipelines.Search.SearchArgs..ctor(Sitecore.ContentSearch.IProviderSearchContext, Sitecore.Data.Items.Item, Sitecore.Data.Items.Item, System.String, System.String)’.
    Source: Sitecore.Support.406795
    at Sitecore.Support.ItemWebApi.Pipelines.Request.Search.RunSearchPipeline(RequestArgs args, String searchText, String languageName)
    at Sitecore.Support.ItemWebApi.Pipelines.Request.Search.Process(RequestArgs args)
    at (Object , Object[] )
    at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
    at Sitecore.ItemWebApi.Pipelines.HttpRequest.LaunchRequest.Process(HttpRequestArgs arguments)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.