Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview of Umbraco.MultipleTextstring #46

Open
kows opened this issue Jan 16, 2024 · 2 comments
Open

Preview of Umbraco.MultipleTextstring #46

kows opened this issue Jan 16, 2024 · 2 comments

Comments

@kows
Copy link

kows commented Jan 16, 2024

Not sure if this is related to package or Umbraco's internal BlockEditorConverter.

Value is passed as [{value: "A"}, {value: "B"}, {value: "C"}] to PreviewMarkup call.
Same value for the GetById call in the backoffice.
Also previewed as that value, so the conversion located in MultipleTextStringPropertyValueEditor is not happening.

@kows
Copy link
Author

kows commented Jan 16, 2024

fyi working around this with specific code for preview:

   @if (Context.Request.IsBlockPreviewRequest())
   {
       var headers = string.Join("", Model.Tableheaders);
       var array = JArray.Parse(headers);
       Model.Tableheaders = array.OfType<JObject>()
                                 .Where(x => x["value"] != null)
                                 .Select(x => x["value"]!.Value<string>())
                                 .ToList();
   }

@rickbutterfield
Copy link
Owner

rickbutterfield commented Mar 14, 2024

@kows I've tried running the latest version of BlockPreview against Umbraco source, and it appears to be a problem with the MultipleTextStringValueConverter. The converter is expecting either a string with NewLine or XML, but the rendered front end value is a JSON array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants