Migrations: Create missing tabs on content types when referenced by both composition and content type groups (closes #20058) (#20303)

* Add migration to create missing tabs

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.

* Small fixes

* WIP: Integration test.

* Added asserts to show the current issue with the integration test.

* Adjusted the integration test

* Added logging of result. Minor re-order and extraction refactoring in integration test.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
Laura Neto
2025-10-01 09:39:56 +02:00
committed by GitHub
parent 1082bf17b2
commit a84d67eff8
5 changed files with 401 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ public class PropertyGroupBuilder<TParent>
private int? _sortOrder;
private bool? _supportsPublishing;
private DateTime? _updateDate;
private PropertyGroupType? _type;
public PropertyGroupBuilder(TParent parentBuilder)
: base(parentBuilder)
@@ -99,6 +100,12 @@ public class PropertyGroupBuilder<TParent>
set => _updateDate = value;
}
public PropertyGroupBuilder<TParent> WithType(PropertyGroupType type)
{
_type = type;
return this;
}
public PropertyGroupBuilder<TParent> WithPropertyTypeCollection(PropertyTypeCollection propertyTypeCollection)
{
_propertyTypeCollection = propertyTypeCollection;
@@ -122,6 +129,7 @@ public class PropertyGroupBuilder<TParent>
var name = _name ?? Guid.NewGuid().ToString();
var sortOrder = _sortOrder ?? 0;
var supportsPublishing = _supportsPublishing ?? false;
var type = _type ?? PropertyGroupType.Group;
PropertyTypeCollection propertyTypeCollection;
if (_propertyTypeCollection != null)
@@ -145,7 +153,8 @@ public class PropertyGroupBuilder<TParent>
Name = name,
SortOrder = sortOrder,
CreateDate = createDate,
UpdateDate = updateDate
UpdateDate = updateDate,
Type = type,
};
}
}