Avoid throwing an exception on getting references when migrating content with changed data types (16)#20155
Merged
AndyButland merged 2 commits intomainfrom Sep 16, 2025
Conversation
…ent with changed data types.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR forward ports a fix from Umbraco 15 to prevent exceptions when retrieving references during content migration with changed data types. The changes focus on improving error handling in block editors by adding logging capabilities and avoiding fatal exceptions when deserializing invalid block data.
- Adds logger parameter to block editor constructors to enable proper error logging
- Replaces exception-throwing deserialization with safe parsing that logs warnings
- Improves resilience during content migration scenarios where data format mismatches occur
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| BlockEditorPropertyValueEditor.cs | Main implementation with new constructor overload, logger field, and safe parsing method with warning logs |
| BlockListPropertyEditorBase.cs | Updates constructor call to pass logger parameter to base class |
| BlockGridPropertyEditorBase.cs | Updates constructor call to pass logger parameter to base class |
src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
Show resolved
Hide resolved
src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
Show resolved
Hide resolved
kjac
approved these changes
Sep 16, 2025
Contributor
kjac
left a comment
There was a problem hiding this comment.
@AndyButland I reintroduced the generic catch to avoid a potential functional breaking change here. Other than that it looks good 👍
I'll leave it up to you to merge, in case you have any objections with my change 😄
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.
Forward port of #20079 for Umbraco 16.
See linked PR for details.