Fixes: #U4-2183 - null check on UmbracoContext and fixes bad merge issue, the UserTypeCacheRefresher got removed from the proj file.

This commit is contained in:
Shannon Deminick
2013-05-02 14:24:27 -10:00
parent eca01b845c
commit 294c2f4fba
3 changed files with 13 additions and 8 deletions

View File

@@ -215,10 +215,12 @@ namespace Umbraco.Web.Cache
// zpqrtbnk: no, not here, in fact the caches should subsribe to refresh events else we
// are creating a nasty dependency - but keep it like that for the time being while
// SD is cleaning cache refreshers up.
var contentCache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache;
if (contentCache != null)
contentCache.RoutesCache.Clear();
if (UmbracoContext.Current != null)
{
var contentCache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache;
if (contentCache != null)
contentCache.RoutesCache.Clear();
}
}
}
}

View File

@@ -47,10 +47,12 @@ namespace Umbraco.Web.Cache
// zpqrtbnk: no, not here, in fact the caches should subsribe to refresh events else we
// are creating a nasty dependency - but keep it like that for the time being while
// SD is cleaning cache refreshers up.
var contentCache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache;
if (contentCache != null)
contentCache.RoutesCache.Clear();
if (UmbracoContext.Current != null)
{
var contentCache = UmbracoContext.Current.ContentCache.InnerCache as PublishedContentCache;
if (contentCache != null)
contentCache.RoutesCache.Clear();
}
}
}
}

View File

@@ -282,6 +282,7 @@
<Compile Include="Cache\StylesheetPropertyCacheRefresher.cs" />
<Compile Include="Cache\TemplateCacheRefresher.cs" />
<Compile Include="Cache\UserCacheRefresher.cs" />
<Compile Include="Cache\UserTypeCacheRefresher.cs" />
<Compile Include="Configuration\WebRouting.cs" />
<Compile Include="Dynamics\DynamicExpression.cs" />
<Compile Include="Dynamics\DynamicGrouping.cs" />