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

Clean up null values in datatype configs #16296

Merged
merged 2 commits into from
May 21, 2024

Conversation

kjac
Copy link
Contributor

@kjac kjac commented May 15, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

We're seeing null values for datatype configurations when migration older (V11?) databases to V14. It mostly seem to happen for empty array configurations, and it looks like the System.Text.Json serializer doesn't know what to do with those.

This is not happening for V13 databases. It seems like V13 does not store empty array config values.

The null values are particularly problematic for the default file upload editor (with no allowed types configured). The editor expects a non-nullable array of allowed file extensions, but the stored config value is null and thus the array is initialized with a null value during deserialization. The result is a fine error message when attempting to upload a new file:

image

To fix it, this PR adds a new migration to root out all null value configuration entries for all core datatypes.

Testing this PR

It's a little tricky to test since it only happens in certain rare cases. But reach out to @kjac for a test DB and some instructions 😄

kjac and others added 2 commits May 15, 2024 11:35
…tions

# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected after merging in dev 👍

@Migaroez Migaroez merged commit 5a75488 into v14/dev May 21, 2024
3 checks passed
@Migaroez Migaroez deleted the v14/fix/clean-up-empty-datatype-configurations branch May 21, 2024 07:50
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

Successfully merging this pull request may close these issues.

None yet

2 participants