File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/Umbraco.Deploy.Contrib/Migrators Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,25 @@ public ReplaceDocTypeGridEditorDataTypeArtifactMigrator(PropertyEditorCollection
59
59
60
60
// Migrate DTGE editors
61
61
var allElementTypes = GetAllElementTypes ( ) . ToList ( ) ;
62
+ var migratedContentTypeKeys = new HashSet < Guid > ( ) ;
62
63
foreach ( IGridEditorConfig gridEditor in GetGridEditors ( gridLayouts ) . Where ( IsDocTypeGridEditor ) )
63
64
{
64
65
foreach ( Guid contentElementTypeKey in MigrateDocTypeGridEditor ( gridEditor , allElementTypes ) )
65
66
{
66
- yield return ( gridEditor . Alias , new BlockGridBlockConfiguration ( )
67
+ // Avoid DocTypeGridEditors returning duplicate block configurations for the same content element type
68
+ if ( migratedContentTypeKeys . Add ( contentElementTypeKey ) )
67
69
{
68
- ContentElementTypeKey = contentElementTypeKey ,
69
- Label = gridEditor . Config . TryGetValue ( "nameTemplate" , out var nameTemplateConfig ) && nameTemplateConfig is string nameTemplate && ! string . IsNullOrEmpty ( nameTemplate )
70
+ yield return ( gridEditor . Alias , new BlockGridBlockConfiguration ( )
71
+ {
72
+ ContentElementTypeKey = contentElementTypeKey ,
73
+ Label = gridEditor . Config . TryGetValue ( "nameTemplate" , out var nameTemplateConfig ) && nameTemplateConfig is string nameTemplate && ! string . IsNullOrEmpty ( nameTemplate )
70
74
? nameTemplate
71
75
: gridEditor . NameTemplate ,
72
- EditorSize = gridEditor . Config . TryGetValue ( "overlaySize" , out var overviewSizeConfig ) && overviewSizeConfig is string overviewSize && ! string . IsNullOrEmpty ( overviewSize )
76
+ EditorSize = gridEditor . Config . TryGetValue ( "overlaySize" , out var overviewSizeConfig ) && overviewSizeConfig is string overviewSize && ! string . IsNullOrEmpty ( overviewSize )
73
77
? overviewSize
74
78
: null ,
75
- } ) ;
79
+ } ) ;
80
+ }
76
81
}
77
82
}
78
83
}
You can’t perform that action at this time.
0 commit comments