Clean up null values in datatype configs#16296
Merged
Migaroez merged 2 commits intoMay 21, 2024
Merged
Conversation
…tions # Conflicts: # src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
Migaroez
approved these changes
May 21, 2024
Migaroez
left a comment
Contributor
There was a problem hiding this comment.
Works as expected after merging in dev 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
We're seeing
nullvalues for datatype configurations when migration older (V11?) databases to V14. It mostly seem to happen for empty array configurations, and it looks like theSystem.Text.Jsonserializer 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
nullvalues 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 isnulland thus the array is initialized with anullvalue during deserialization. The result is a fine error message when attempting to upload a new file:To fix it, this PR adds a new migration to root out all
nullvalue 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 😄