Few more NRT tweaks (#12323)
* Amended GetAll() on IDataTypeService to return an empty collection rather than null. * Added a ClearSessionValue method to ISessionManager (given you can no longer set a value to null). * Allow for null values in a StatefulNotification. * Removed obsoletion of synchronous messages on TreeControllerBase. * Fixed further CS8620 warnings in core project. * Further fix to nullable warning. * Aligned nullablility of retreiving tree nodes and menus, synchronously or asynchronously (such that we no longer can get null values, always empty collection objects).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Cms.Core.PropertyEditors;
|
||||
@@ -84,7 +84,7 @@ namespace Umbraco.Cms.Core.Models.PublishedContent
|
||||
if (_publishedDataTypes == null)
|
||||
{
|
||||
var dataTypes = _dataTypeService.GetAll();
|
||||
_publishedDataTypes = dataTypes?.ToDictionary(x => x.Id, CreatePublishedDataType);
|
||||
_publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType);
|
||||
}
|
||||
|
||||
publishedDataTypes = _publishedDataTypes;
|
||||
@@ -104,7 +104,7 @@ namespace Umbraco.Cms.Core.Models.PublishedContent
|
||||
if (_publishedDataTypes == null)
|
||||
{
|
||||
var dataTypes = _dataTypeService.GetAll();
|
||||
_publishedDataTypes = dataTypes?.ToDictionary(x => x.Id, CreatePublishedDataType);
|
||||
_publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -112,11 +112,8 @@ namespace Umbraco.Cms.Core.Models.PublishedContent
|
||||
_publishedDataTypes.Remove(id);
|
||||
|
||||
var dataTypes = _dataTypeService.GetAll(ids);
|
||||
if (dataTypes is not null)
|
||||
{
|
||||
foreach (var dataType in dataTypes)
|
||||
_publishedDataTypes[dataType.Id] = CreatePublishedDataType(dataType);
|
||||
}
|
||||
foreach (var dataType in dataTypes)
|
||||
_publishedDataTypes[dataType.Id] = CreatePublishedDataType(dataType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user