This is of course an issue with the items who are in a date based bucket. You may also have some unexpected results if you have some of the reserved keywords in the item name as "and", "or", "self", "children", "parent", "sibilings", ...
So, I have create a function to "sanitize" your queries before the Sitecore queries.
And an example of the SanitizeQuery: the SanitizeQuery function:
var myQuery = "/sitecore/content/TestSites/Test/09/28/15/56/*".SanitizeQuery(); var item = Sitecore.Context.ContentDatabase.SelectSingleItem(myQuery);
You will find this repository here: https://github.com/VGBenjamin/Sitecore.Utility
If you have functions that you would like to share in this directory you can of course propose it this could become a new collaborative repository.
No comments:
Post a Comment