From d11fd67a093827e577cab4c685528ea56d1316fb Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 6 Feb 2019 19:04:58 +0100 Subject: [PATCH] Bugfix PublishedContentTypeFactory --- .../PublishedContentTypeFactory.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs index 8a44a7a9b4..2ca3593b55 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs @@ -87,8 +87,20 @@ namespace Umbraco.Core.Models.PublishedContent { lock (_publishedDataTypesLocker) { - var dataTypes = _dataTypeService.GetAll(ids); - _publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType); + if (_publishedDataTypes == null) + { + var dataTypes = _dataTypeService.GetAll(); + _publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType); + } + else + { + foreach (var id in ids) + _publishedDataTypes.Remove(id); + + var dataTypes = _dataTypeService.GetAll(ids); + foreach (var dataType in dataTypes) + _publishedDataTypes[dataType.Id] = CreatePublishedDataType(dataType); + } } }