Multilist with Search Querying bug: Sitecore 7.1

I ran into an interesting issue with the Multilist with Search control within Sitecore 7.1. I had a template which I use to query item buckets. They sit in the root of the item bucket and allow for a user to specify a query of items within the bucket and a way to pin items to the top of the query. The pinned items within the template used a Multilist with Search field to select all items in the item bucket using the following as its source:
StartSearchLocation=query:parent::*&Filter=_latestVersion:*|-_templatename:Saved Query
Simple enough query: Go up one level, return only the latest version of the items in the bucket, and don't return Saved Query templates - which is the template for the query item in question.



Everything worked perfectly at first, but then a new year launched and suddenly I had content editors screaming that items weren't available within the multilist with search control. It took me a little bit to figure out but the query wasn't going to the parent, but the first year folder within the bucket. It turns out that query:parent::* isn't working (same with ancestor). It is a bug within Sitecore but it at least has a workaround. Instead of using parent, I ended up using .. instead. Final source is below:

StartSearchLocation=query:..&Filter=_latestVersion:*|-_templatename:Saved Query

Hopefully this helps the next developer who runs into this scenario! 

Comments