Bugfix PublishedContentTypeFactory

This commit is contained in:
Stephan
2019-02-06 19:04:58 +01:00
parent 1703c918d9
commit d11fd67a09

View File

@@ -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);
}
}
}