Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Bug in CMS.TreeEngine.TreeProvider.SelectNodes() function? View modes: 
User avatar
Member
Member
markcoatsworth - 5/18/2011 8:12:47 PM
   
Bug in CMS.TreeEngine.TreeProvider.SelectNodes() function?
Hi there,

I'm having a problem with the CMS.TreeEngine.TreeProvider.SelectNodes() function. It looks like a bug in the software, but it's possible I'm not using it correctly.

This is the specific overload method I'm using:

public virtual DataSet SelectNodes(string siteName, string aliasPath, string cultureCode, bool combineWithDefaultCulture, string classNames, string where);

The problem is that the cultureCode argument does not work. No matter what value I pass to cultureCode, the function returns documents based on whatever culture is currently selected in the site.

So for example if "en-CA" is my current culture, then only documents in en-CA culture are retrieved by SelectNodes(). Even if I pass a different CultureCode.

Is this a bug, or am I just using it incorrectly? I've applied the latest hotfix and the problem is still happening.

Thanks!

Mark


User avatar
Member
Member
kentico_michal - 5/19/2011 2:02:42 AM
   
RE:Bug in CMS.TreeEngine.TreeProvider.SelectNodes() function?
Hi Mark,

Could you please let me know which version of Kentico CMS you are using?

I tried to reproduce this issue in Kentico CMS 5.5 R2 and it worked correctly.

Moreover, could you please post here the code snippet you are using to get the selected nodes?


Best regards,
Michal Legen

User avatar
Member
Member
markcoatsworth - 5/24/2011 3:55:09 PM
   
RE:Bug in CMS.TreeEngine.TreeProvider.SelectNodes() function?
Sorry for the slow reply Michal!

You're right, the function is working fine. It was an error in my code.

I was using TreeProvider.SelectNodes to retrieve a list of nodes, but then I looped through the nodes and used TreeNode.SelectSingleNode to retrieve each individual document.

I was not passing the culture code to TreeNode.SelectSingleNode. Once I started doing this everything worked properly.

Sorry for the false alarm.

Mark