Multilist with Search field does not work when using Sitecore Query in StartSearchLocation source parameter


Description

When using Multilist with Search field with the StartSearchLocation source parameter set as Sitecore query, for example like this:

StartSearchLocation=query:ancestor-or-self::*[@@name->'Home']

The following error may appear in the Content Editor:

Field control has failed to render: Unexpected character '\'

The following exception would also be found in the Sitecore log files:

5060 13:39:55 ERROR Content editor field has failed to render
Exception: Sitecore.Exceptions.QueryException
Message: Unexpected character '\'
Source: Sitecore.Kernel
   at Sitecore.Data.Query.Tokenizer.NextToken()
   ...
   at Sitecore.Data.Query.QueryParser.DoParse(String query)
   at Sitecore.Buckets.FieldTypes.SearchList.MakeFilterQueryable(String locationFilter)
   at Sitecore.Buckets.FieldTypes.SearchList.GetItems(Item current)
   at Sitecore.Buckets.FieldTypes.SearchList.DoRender(HtmlTextWriter output)
   at Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at Sitecore.Shell.Applications.ContentEditor.EditorFieldContainer.RenderChildren(HtmlTextWriter writer)

Solution

Apply the following patch to resolve the issue:

  1. Place the attached Sitecore.Support.410621.dll assembly to the /Website/bin folder.
  2. Open the Core database using the Content Editor application.
  3. Navigate to the /sitecore/system/Field types/List Types/Multilist with Search item.
  4. Change the Control field to an empty value.
  5. Change the Assembly field to the following value:
    Sitecore.Support.410621
  6. Change the Class field to the following value:
    Sitecore.Support.Buckets.FieldTypes.BucketList

When experiencing the same issue with the Treelist with Search field, please use the Multilist with Search field instead. The Treelist with Search field has been deprecated in Sitecore CMS 7.2 rev. 140228 (Initial Release) version. Please refer to the release notes for more details.