List title not set in lamda expression when multiple languages turned on
I am pulling list items through code in a custom control. Before I added a new language I was able to access the items I needed through the following code:
var items = lm.GetListItems()
.Where(li => li.Parent.Title == "Home Page Slides");
var items = lm.GetListItems()
.Where(li => String.IsNullOrEmpty(li.Parent.Title));
foreach (Telerik.Sitefinity.Lists.Model.ListItem li in items)
Response.Write("ITEM TITLE: " + li.Title + " PARENT TITLE: " + li.Parent.Title + "<
BR
>");
Hello Michael,
Thank you for contacting us!
This is known issue and it is fixed. It will be released within the upcoming Service Pack(e.g. SP1), which will be available till begin of the next week.
There is also workaround in case you are not planning to update your installation to SP1. Lets assumed that there are two applied languages in given Sitefinity's installation: English([en] -> which is default for the system) and French([fr]). In such case you should write your filter expression like this:
lm.GetItems(typeof(Telerik.Sitefinity.Lists.Model.ListItem), "Title.Contains(\"Home Page Slides
\") OR (Title[\"en\"] = null AND Title[\"fr\"] = null AND Title[\"\"].Contains(\"Home Page Slides
\"))", string.Empty, 0, 100);