blog
Bug Found with Filtering by Template Name in Sitecore 7.0's Multilist with Search Field

In today's Sitecore Tip of the Day, we will look at the bug found with Sitecore 7.0's _templatename filter parameter for the Multilist with Search field, as well as a couple of workarounds provided by Sitecore support. Note that this bug may be occuring in other versions of Sitecore 7 as well, but I have only tested and confirmed it on Sitecore 7.0 to date.

Just to briefly praise Sitecore support, I found and reported this bug yesterday and, in barely over three hours, Sitecore support confirmed it was occuring on a clean installation of Sitecore, provided two workarounds and registered it as a bug - Sitecore's support rocks!

The Bug

When working with the _templatename filter for Sitecore 7.0's Multilist with Search, there is a that causes any searching or clicking to the next or previous "page" of items in the selection pane to become empty, even though the first "page" of items are listed correctly when initially viewing the item before trying to search/navigate.

Per the syntax specified by Sitecore, the following should be the correct syntax for filtering the result items to only allow those with a template named "BrightcoveVideo":

StartSearchLocation={110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&Filter=+_templatename:BrightcoveVideo

This syntax, however, will reproduce the bug. Note that I have not tested to see if this bug exists with the Treelist with Search field as well (though the Treelist with Search field type is deprecated in Sitecore 7.2), nor other field types.

The Workarounds

Sitecore support provided me with two workarounds for this issue. First, removing the + prefix for the _templatename parameter will result in the field operating as expected. For example:

StartSearchLocation={110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&Filter=_templatename:BrightcoveVideo

## instead of ##

StartSearchLocation={110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&Filter=+_templatename:BrightcoveVideo 

Alternatively, instead of using the Filter parameter, the TemplateFilter parameter can be used and provided a comma-delimited string of Template IDs. For example, the following could be used:

StartSearchLocation={110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&TemplateFilter={5E840804-D12E-4D1F-A30F-C1A71F32F63C}

where {5E840804-D12E-4D1F-A30F-C1A71F32F63C} is the ID of the BrightcoveVideo Template.

...

Note that I have tested both of these workarounds and have confirmed that they are working.

1 Comments
Post a Comment

 
  • Comment by EC on Apr 08, 2016
    Bug is still present and has expanded to break the workarounds for Multilist with Search on Sitecore 8.1 it seems...