Posted 04/15/2014 by Akshay Sura
The Multilist with Search control is very useful, especially when using it with items in an Item Bucket. The issue is that all the new controls with search are not properly documented. There are several blog posts online providing different ways to set the source in order to get the desired results.
The issue we faced was specifically in Sitecore 7.1 (rev. 130926).
Issue/Bug: When Multilist with Search control was used in a source item which was located in the same item bucket as the datasource for the Multilist, it did not render any results and the search would fail. If the source item is located outside of the item bucket the Multilist with Search works fine.
For example, a product having similar products field. The products node is an Item Bucket with product items, for each product item there is a field to tag similar products which points back to the Item Bucket.
So I added a Sitecore support ticket and started working with the support Tech. Once we were able to reproduce this on multiple environments we knew this was a real bug.
First step was to remove all customizations and that did not help. It ended up being the combination of the Link Provider’s languageEmbedding setting and Item Bucket’s Show Search Results setting (/sitecore/system/Settings/Buckets/Item Buckets Settings).
If the Item Bucket’s ‘Show Search Results’ setting is set to New Tab and the Link Provider’s languageEmbedding=”asNeeded” it works.
If the Item Bucket’s ‘Show Search Results’ setting is set to New Tab and the Link Provider’s languageEmbedding=”always” it fails.
The setting I was trying to use was to set the Show Search Results to open in a New Content Editor and languageEmbedding as always. Sitecore filed an official bug and provided a bug fix.
Here is how you apply the patch:
1. Place the Sitecore.Support.406408.dll assembly to the Bin folder.
2. In the WebsitesitecoreshellApplicationsBucketsScripts folder, rename the ‘ItemBucket.js’ file to ‘ItemBucket.js.ORIGINAL’. Place the attached ItemBucket.js file to the folder.
3. In the uiLaunchSearchResult pipeline of the web.config file, replace the following processor:
<processor mode=”on” type=”Sitecore.Shell.Framework.Pipelines.LaunchSearchResult,Sitecore.Kernel” method=”OpenItem”/>
with this one:
<processor mode=”on” type=”Sitecore.Support.Shell.Framework.Pipelines.LaunchSearchResult,Sitecore.Support.406408″ method=”OpenItem”/>
4. In the Commands.config file, replace the following command:
<command name=”search:launchresult” type=”Sitecore.Shell.Applications.Search.Instant.Commands.LaunchResult,Sitecore.Client”/>
with this one
<command name=”search:launchresult” type=”Sitecore.Support.Shell.Applications.Search.Instant.Commands.LaunchResult,Sitecore.Support.406408″/>
5. Clear browser cache.
Here is the link to the zip file.
In the process of resolving this bug, I ended up replicating the Multilist with Search, which basically uses a web handler (.ashx) to process the request. If you require the code please get in touch with me.