Members: Fix EntityContainer.GetUdi() for member type containers#20840
Merged
AndyButland merged 1 commit intorelease/17.0from Nov 14, 2025
Merged
Members: Fix EntityContainer.GetUdi() for member type containers#20840AndyButland merged 1 commit intorelease/17.0from
EntityContainer.GetUdi() for member type containers#20840AndyButland merged 1 commit intorelease/17.0from
Conversation
AndyButland
approved these changes
Nov 14, 2025
Contributor
AndyButland
left a comment
There was a problem hiding this comment.
Good catch, thanks @ronaldbarendse. This will come in 17.0-rc3.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a NotSupportedException that occurred when using Umbraco Deploy with member type containers by adding missing support for member type containers in the EntityContainer.GetUdi() extension method. The changes also improve code organization by alphabetizing the container type entries.
Key changes:
- Added MemberType container support to
GetUdi()extension method - Alphabetized container type entries across all affected files for better maintainability
- Fixed incorrect null comparison for Guid value type in
GetContainedObjectType()
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Umbraco.Core/Extensions/UdiGetterExtensions.cs | Added MemberType container case and reordered cases alphabetically |
| src/Umbraco.Core/Models/EntityContainer.cs | Alphabetized ObjectTypeMap entries and fixed null comparison bug for Guid |
| tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/UdiGetterExtensionsTests.cs | Added test case for MemberType container and reordered test cases alphabetically |
EntityContainer.GetUdi() for member type containersEntityContainer.GetUdi() for member type containers
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.
Besides the preparations done in #20715 to support member type containers, I encountered an issue in 17.0.0-rc2 while trying to add initial support in Deploy.
Within Deploy, notification handlers are registered for all entity container operations (e.g.
EntityContainerSavedNotification) to ensure schema/UDA files and signatures are updated. However, this caused the following exception:Although not obvious from the stack trace, searching for the error message highlighted the
EntityContainer.GetUdi()extension method not yet updated to support this new object type. And Deploy uses UDIs when updating the schema/signatures, so it makes sense that this only occurred when its installed.Besides adding the missing member type, I've ordered them alphabetically now and updated the test to ensure the correct UDI is returned.