Stack overflow exception

Oct 12, 2011 at 8:00 PM

Hi!

I just wanted to point out the stack overflow exception that happens when you add a widget to show recent content for any content part types used inside of a RecentContent widget (like CommonPart or WidgetPart). It's caused by adding RecentContent widget at the resulting list which again adds another RecentContent widget and so forth.

I solved it by chaning the very beginning of Display function of RecentContentWidgetPartDriver.cs by modifying contentTypes variable declaration to following:

var contentTypes = _contentManager.GetContentTypeDefinitions()
                .Where(x => x.Name != "RecentContent" && x.Parts.Any(p => p.PartDefinition.Name == part.ForContentPart))
                .Select(x => x.Name)
                .ToArray();

I've highlighted the change I made by blue color.