Skip to content

Commit c22a1a2

Browse files
committed
Re-adding Skybrud.Essentials dependency as we need it
The "Cast" and "ToList" extension methods from Skybrud.Essentials are essential (no pun intented) to outputting the correct property values.
1 parent 83c3818 commit c22a1a2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Skybrud.Umbraco.MultiNodeTreePicker/PropertyEditors/ValueConverters/MntpValueConverter.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using Skybrud.Essentials.Collections.Extensions;
5+
using Skybrud.Essentials.Json.Extensions;
46
using Skybrud.Umbraco.MultiNodeTreePicker.Composers;
57
using Skybrud.Umbraco.MultiNodeTreePicker.Converters;
68
using Umbraco.Cms.Core;
@@ -55,7 +57,7 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
5557

5658
if (propertyType.DataType.Configuration is MntpConfiguration config && config.ItemConverter != null) {
5759

58-
string key = config.ItemConverter.GetValue("key").ToString();
60+
string key = config.ItemConverter.GetString("key");
5961

6062
if (_converterCollection.TryGet(key, out IMntpItemConverter converter)) {
6163

@@ -67,8 +69,8 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
6769

6870
return (value as IEnumerable<IPublishedElement> ?? new IPublishedElement[0])
6971
.Select(x => converter.Convert(propertyType, x))
70-
//.Cast<type>()
71-
.ToList();
72+
.Cast(type)
73+
.ToList(type);
7274

7375
}
7476

@@ -86,7 +88,7 @@ public override Type GetPropertyValueType(IPublishedPropertyType propertyType) {
8688

8789
if (propertyType.DataType.Configuration is MntpConfiguration config && config.ItemConverter != null) {
8890

89-
string key = config.ItemConverter.GetValue("key").ToString();
91+
string key = config.ItemConverter.GetString("key");
9092

9193
if (_converterCollection.TryGet(key, out IMntpItemConverter converter)) {
9294

src/Skybrud.Umbraco.MultiNodeTreePicker/Skybrud.Umbraco.MultiNodeTreePicker.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31+
<PackageReference Include="Skybrud.Essentials" Version="1.1.33" />
3132
<PackageReference Include="Umbraco.Cms.Core" Version="9.0.0" />
3233
<PackageReference Include="Umbraco.Cms.Web.Website" Version="9.0.0" />
3334
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="9.0.0" />

0 commit comments

Comments
 (0)