From a12361deb5413772e1fe48414a2084811ef3a79b Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 23 Jan 2024 18:56:47 +0100 Subject: [PATCH] Fixed test --- .../PropertyEditors/BlockValuePropertyValueEditorBase.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs index c908a3cc81..775a3cd532 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs @@ -39,6 +39,7 @@ internal abstract class BlockValuePropertyValueEditorBase : DataValueEditor, IDa protected IEnumerable GetBlockValueReferences(BlockValue blockValue) { + var result = new HashSet(); BlockItemData.BlockPropertyValue[] propertyValues = blockValue.ContentData.Concat(blockValue.SettingsData) .SelectMany(x => x.PropertyValues.Values).ToArray(); foreach (IGrouping valuesByPropertyEditorAlias in propertyValues.GroupBy(x => x.PropertyType.PropertyEditorAlias, x => x.Value)) @@ -54,7 +55,7 @@ internal abstract class BlockValuePropertyValueEditorBase : DataValueEditor, IDa { foreach (UmbracoEntityReference value in districtValues.SelectMany(reference.GetReferences)) { - yield return value; + result.Add(value); } } @@ -62,10 +63,11 @@ internal abstract class BlockValuePropertyValueEditorBase : DataValueEditor, IDa foreach (UmbracoEntityReference value in references) { - yield return value; + result.Add(value); } - } + + return result; } ///