Question

We have a sitecore support ticket open for this issue, but I hope I could get someone else that's experienced this issue also.

Here is the output from my immediate window while debugging my sitecore 6.6 instance:

?db.SelectSingleItem("/sitecore/content/Www/Data/Recruiting/Metadata/Companies/00000001/*[@@name='0000001873']")
null
?db.SelectSingleItem("/sitecore/content/Www/Data/Recruiting/Metadata/Companies/00000001/*")
0000001873 (en#1@web), id: {1848E256-E7C2-4BFC-9AF7-72EE14E37C82}
Database: "web"
Id: "{1848E256-E7C2-4BFC-9AF7-72EE14E37C82}"
Language: "en"
Name: "0000001873"
Version: "1"

Basically when I run either SelectSingleItem or GetItem and include any attribute (@@id or @@name), I get null returned. However, if I remove the filtering attribute I do get a result set. Notice that the result set I get without the filter, is the first item in the list, is also the item I'm searching for with the @@name attribute.

I get this result ONLY in code. Using xPath designer I get a result.

Was it helpful?

Solution

I encountered a similar issue and it ended up being a folder whose name started with the number zero. I chalked it up as a potential issue with the way Sitecore parses queries and didn't look into it much further. Try escaping the folder name like so:

/sitecore/content/Www/Data/Recruiting/Metadata/Companies/#00000001#/*[@@name='0000001873']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top