#19347: fix for issue 19347

Work Item: 19347
This commit is contained in:
brporter
2014-09-14 11:34:08 +01:00
committed by Nicholas Mayne
parent 5a2f7be1af
commit 03e72cb931
2 changed files with 13 additions and 1 deletions
@@ -49,6 +49,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -19,17 +19,20 @@ namespace Orchard.Tags.Services {
private readonly INotifier _notifier;
private readonly IAuthorizationService _authorizationService;
private readonly IOrchardServices _orchardServices;
private readonly ISessionFactoryHolder _sessionFactoryHolder;
public TagService(IRepository<TagRecord> tagRepository,
IRepository<ContentTagRecord> contentTagRepository,
INotifier notifier,
IAuthorizationService authorizationService,
IOrchardServices orchardServices) {
IOrchardServices orchardServices,
ISessionFactoryHolder sessionFactoryHolder) {
_tagRepository = tagRepository;
_contentTagRepository = contentTagRepository;
_notifier = notifier;
_authorizationService = authorizationService;
_orchardServices = orchardServices;
_sessionFactoryHolder = sessionFactoryHolder;
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
@@ -207,6 +210,11 @@ namespace Orchard.Tags.Services {
}
contentItem.As<TagsPart>().CurrentTags = tagNamesForContentItem;
var sessionFactory = _sessionFactoryHolder.GetSessionFactory();
if (sessionFactory != null)
sessionFactory.EvictCollection("Orchard.Tags.Models.TagsPartRecord.Tags", contentItem.As<TagsPart>().Record.Id);
}
}