diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj index 71416474e..72ae1c7e4 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj +++ b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj @@ -49,6 +49,10 @@ + + False + ..\..\..\..\lib\nhibernate\NHibernate.dll + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs index aff0474bf..93dd19768 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs @@ -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 tagRepository, IRepository 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().CurrentTags = tagNamesForContentItem; + + var sessionFactory = _sessionFactoryHolder.GetSessionFactory(); + + if (sessionFactory != null) + sessionFactory.EvictCollection("Orchard.Tags.Models.TagsPartRecord.Tags", contentItem.As().Record.Id); } }