Adds new ValueReference classes and update to Interface for IsForEditor method to check if we should get references for a specific dataeditor based on its alias
This commit is contained in:
@@ -23,25 +23,12 @@ namespace Umbraco.Web.PropertyEditors
|
||||
|
||||
protected override IDataValueEditor CreateValueEditor() => new MultiNodeTreePickerPropertyValueEditor(Attribute);
|
||||
|
||||
public class MultiNodeTreePickerPropertyValueEditor : DataValueEditor, IDataValueReference
|
||||
public class MultiNodeTreePickerPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
public MultiNodeTreePickerPropertyValueEditor(DataEditorAttribute attribute): base(attribute)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<UmbracoEntityReference> GetReferences(object value)
|
||||
{
|
||||
var asString = value == null ? string.Empty : value is string str ? str : value.ToString();
|
||||
|
||||
var udiPaths = asString.Split(',');
|
||||
foreach (var udiPath in udiPaths)
|
||||
{
|
||||
if (Udi.TryParse(udiPath, out var udi))
|
||||
yield return new UmbracoEntityReference(udi);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user