-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Migrations: Create missing tabs on content types when referenced by both composition and content type groups (closes #20058) #20303
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
Conversation
In v13, if a tab had groups in both a composition and the content type, the tab might not exist on the content type itself. Newer versions require such tabs to also exist directly on the content type. This migration ensures those tabs are created. Also fixes an issue in LeftJoin where nested sql arguments were being discarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a migration to fix missing tabs on content types that are referenced by both composition and content type groups. The migration ensures tabs are explicitly created on content types even when they exist in compositions, aligning with newer Umbraco versions and preventing UI issues.
- Adds a new migration
CreateMissingTabs
for v16.4.0 to identify and create missing tabs - Enhances SQL extension methods to support the migration's complex query requirements
- Registers the migration in the Umbraco upgrade plan
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/Umbraco.Infrastructure/Persistence/NPocoSqlExtensions.cs | Adds new SelectDistinct overload with table alias support and fixes LeftJoin method implementation |
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_4_0/CreateMissingTabs.cs | Main migration class that identifies missing tabs and creates them with proper details from compositions |
src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs | Registers the new migration in the upgrade plan |
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_4_0/CreateMissingTabs.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @lauraneto (particularly on getting the integration test working!). I've done some manual testing and can replicate the original problem and verify the solution.
In my last update, other than a little refactoring to tidy up the integration test a bit, I added logging for the tabs being created. Initially mostly for testing - wanted to verify that the expected update was the only one - but figured it was useful to keep anyway.
If you are happy with it now, please go ahead and merge for 16.4.
Fixes #20058
This pull request adds a migration that ensures that tabs referenced by a content type’s own property groups are explicitly created in the content type, even if they are also referenced by compositions.
This change aligns with newer Umbraco versions, which require these tabs to exist directly on the content type, improving consistency and preventing UI issues.
More details and reproduction steps on the referenced issue.