From 23461b36984292cba422d819256469267642a524 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 28 May 2024 15:27:23 +0200 Subject: [PATCH] Handle the case where the editorvalue is from the db and just is a path. (#16429) --- .../PropertyEditors/FileUploadPropertyValueEditor.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs index 466c456058..beda0418f2 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs @@ -154,6 +154,14 @@ internal class FileUploadPropertyValueEditor : DataValueEditor return null; } + if (editorValue is string sourceString && sourceString.DetectIsJson() is false) + { + return new FileUploadValue() + { + Src = sourceString + }; + } + return _jsonSerializer.TryDeserialize(editorValue, out FileUploadValue? modelValue) ? modelValue : throw new ArgumentException($"Could not parse editor value to a {nameof(FileUploadValue)} object.");