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

[V15] User-defined Checkbox List only stores single item #441

Closed
1 task done
Ambertvu opened this issue Jan 8, 2025 · 1 comment
Closed
1 task done

[V15] User-defined Checkbox List only stores single item #441

Ambertvu opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
affected/v6 type/bug-report Something isn't working
Milestone

Comments

@Ambertvu
Copy link

Ambertvu commented Jan 8, 2025

Which Contentment version are you using?

6.0.0-alpha004

Which Umbraco version are you using? For example: 13.2.1 - don't just write v13

V15.1.0

Bug summary

User-defined Checkbox List only stores single item. ModelsBuilder identifies is as a single string. (no enumerable)

Steps to reproduce

Create a composition and add the following datatype to it:

  • Data List Property Editor UI (Contentment)
  • User-defined List as Data source
  • Checkbox List as List editor

Add two values to the user-defined list (for example x and y).

Select both. View value in frontend.

Expected result / actual result

Expected: Both values are shown as csv, or property is enumerable.

Actual: Property is a string, only the first item is shown.

Do you have Umbraco ModelsBuilder enabled?

  • Yes, it is enabled.

What browsers are you seeing the problem on?

No response

@leekelleher
Copy link
Owner

@Ambertvu Thanks for reporting this. It had me stumped for a while, since the underlying C# code hasn't changed too much.

The bad news was that this bug applied to some other Data List editors too. 😖

The good news is that I have figured it out, and I do have a fix (in commit 2a43dbd). 🎉

The problem started when I migrated JSON deserialization from Newtonsoft to System.Text.Json. Turns out that with the built-in library, when deserializing a JsonObject to a Dictionary<string, object>, the object will be cast as the JsonElement ... which is different to how the Newtonsoft library handled it, so some parts of the Data List code made an assumption on the value types.

Anyway, hopefully my patch fixes this up, but if anything weird comes with related to configuration values, please do let me know.

I'm aiming to have a beta release out soon.

@leekelleher leekelleher added this to the 6.0.0 milestone Jan 17, 2025
@leekelleher leekelleher marked this as a duplicate of #444 Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected/v6 type/bug-report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants