diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs index e77ce3a993..8af2d98018 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs @@ -18,7 +18,7 @@ namespace Umbraco.Web.PropertyEditors ValueType = ValueTypes.Json, Group = Constants.PropertyEditors.Groups.Pickers, Icon = "icon-link")] - public class MultiUrlPickerPropertyEditor : DataEditor, IDataValueReference + public class MultiUrlPickerPropertyEditor : DataEditor { private readonly IEntityService _entityService; private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; @@ -29,18 +29,6 @@ namespace Umbraco.Web.PropertyEditors _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor)); } - public IEnumerable GetReferences(object value) - { - var asString = value == null ? string.Empty : value is string str ? str : value.ToString(); - - if (string.IsNullOrEmpty(asString)) yield break; - - var links = JsonConvert.DeserializeObject>(asString); - foreach (var link in links) - if (link.Udi != null) // Links can be absolute links without a Udi - yield return new UmbracoEntityReference(link.Udi); - } - protected override IConfigurationEditor CreateConfigurationEditor() => new MultiUrlPickerConfigurationEditor(); protected override IDataValueEditor CreateValueEditor() => new MultiUrlPickerValueEditor(_entityService, _publishedSnapshotAccessor, Logger, Attribute); diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs index de641f69a3..ff2ac28986 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs @@ -15,7 +15,7 @@ using Umbraco.Web.PublishedCache; namespace Umbraco.Web.PropertyEditors { - public class MultiUrlPickerValueEditor : DataValueEditor + public class MultiUrlPickerValueEditor : DataValueEditor, IDataValueReference { private readonly IEntityService _entityService; private readonly ILogger _logger; @@ -156,6 +156,18 @@ namespace Umbraco.Web.PropertyEditors return base.FromEditor(editorValue, currentValue); } + public IEnumerable GetReferences(object value) + { + var asString = value == null ? string.Empty : value is string str ? str : value.ToString(); + + if (string.IsNullOrEmpty(asString)) yield break; + + var links = JsonConvert.DeserializeObject>(asString); + foreach (var link in links) + if (link.Udi != null) // Links can be absolute links without a Udi + yield return new UmbracoEntityReference(link.Udi); + } + [DataContract] internal class LinkDto {