diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj
index c86cf5d2d0..45ff5d70f6 100644
--- a/src/Umbraco.Tests/Umbraco.Tests.csproj
+++ b/src/Umbraco.Tests/Umbraco.Tests.csproj
@@ -372,7 +372,6 @@
-
diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
index 20d575c896..6cf8b85ed1 100644
--- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
+++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
@@ -493,12 +493,13 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
///
private IEnumerable GetChildrenMedia(int parentId, XPathNavigator xpath = null)
{
- //if there is no navigator, try examine first, then re-look it up
+ // if there *is* a navigator, directly look it up
if (xpath != null)
{
return ToIPublishedContent(parentId, xpath);
}
+ // otherwise, try examine first, then re-look it up
var searchProvider = GetSearchProviderSafe();
if (searchProvider != null)
@@ -545,7 +546,10 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}
}
- //falling back to get media
+ // falling back to get media
+ // was library.GetMedia which had its own cache, but MediaService *also* caches
+ // so, library.GetMedia is gone and now we directly work with MediaService
+ // (code below copied from what library was doing)
var media = Current.Services.MediaService.GetById(parentId);
if (media == null)
{
@@ -563,13 +567,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
var mediaIterator = serialized.CreateNavigator().Select("/");
- if (mediaIterator.Current == null)
- {
- return Enumerable.Empty();
- }
- xpath = mediaIterator.Current;
-
- return ToIPublishedContent(parentId, xpath);
+ return mediaIterator.Current == null
+ ? Enumerable.Empty()
+ : ToIPublishedContent(parentId, mediaIterator.Current);
}
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index f266213da0..5e59dcc996 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -1190,9 +1190,6 @@
Code
-
- Code
-
Code