Fixes: U4-5714 Calling Index() on IPublishedContent level 1 media fails

This commit is contained in:
Shannon
2014-11-26 10:52:30 +11:00
parent bece953fa3
commit 1930022f19

View File

@@ -1562,9 +1562,11 @@ namespace Umbraco.Web
// what else? would need root content to have a special, non-null but hidden,
// parent...
var siblings = content.Parent == null
? UmbracoContext.Current.ContentCache.GetAtRoot()
: content.Parent.Children;
? content.ItemType == PublishedItemType.Media ? UmbracoContext.Current.MediaCache.GetAtRoot() : UmbracoContext.Current.ContentCache.GetAtRoot()
: content.Parent.Children;
// make sure we run it once
return siblings.ToArray();