sf 4.1 sp1 using orderby in where clause no longer works

Posted by Community Admin on 04-Aug-2018 04:53

sf 4.1 sp1 using orderby in where clause no longer works

All Replies

Posted by Community Admin on 17-May-2011 00:00

so we upgraded to 4.1 sp1 and it broke some of our custom widgets. these widgets allow an editor to choose a category or multiple categories and then display the content from that category in the radrotator and a video list widget. (these are 2 different ones but work similarly)

anyways we were using

foreach (NewsItem item in items.Where(n => n.Status == ContentLifecycleStatus.Live).OrderByDescending(n => n.DateCreated))

but that did not throw any exceptions nor did it display any data. after removing the orderby guess what...it worked fine. i also want to point out this exact same code worked perfectly fine prior to the sp1 update. our last version was 4.1.1367 internal build.

the new code to make our widgets work again after what i consider a bug is the below.

foreach (NewsItem item in items.Where(n => n.Status == ContentLifecycleStatus.Live).Reverse())

Please check your sorting using orderby...I dont see why this doesn't work in the sp1 -
4.1.1395.0 PE

Posted by Community Admin on 19-May-2011 00:00

Hi Brandon,

Thank you for using our services. Can you, please take a look at the provided sample I've just tested, and OrderByDescending was working fine when providing a RadGrid with the results.

var fluent = App.WorkWith();
            var newsItems = fluent.NewsItems()
                .Where(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live).Get().ToList()
                .OrderByDescending(ni => ni.PublicationDate);
            Grid1.DataSource = newsItems;
            Grid1.DataBind();

Can you, please share with us some more details on your custom widget implementation, maybe the behavior you are describing is related to it?


All the best,
Boyan Barnev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed