Skip to content

Conversation

lauraneto
Copy link
Contributor

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.

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.
@lauraneto lauraneto marked this pull request as ready for review September 30, 2025 06:56
@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 06:56
Copy link
Contributor

@Copilot Copilot AI left a 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

@lauraneto lauraneto marked this pull request as draft September 30, 2025 07:34
@lauraneto lauraneto marked this pull request as ready for review September 30, 2025 09:26
Copy link
Contributor

@AndyButland AndyButland left a 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.

@lauraneto lauraneto merged commit a84d67e into main Oct 1, 2025
24 of 25 checks passed
@lauraneto lauraneto deleted the v16/bugfix/migration-from-v13-moving-groups-to-the-generic-tab branch October 1, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document Type Editor issues
2 participants