22using System . Collections . Immutable ;
33using System . Diagnostics ;
44using System . Linq ;
5+ using System . Text . Json ;
56using Microsoft . EntityFrameworkCore ;
67using ToSic . Eav . Apps ;
78using ToSic . Eav . Data ;
89using ToSic . Lib . Logging ;
910using ToSic . Eav . Metadata ;
11+ using ToSic . Eav . Serialization ;
1012
1113namespace ToSic . Eav . Persistence . Efc
1214{
@@ -90,6 +92,9 @@ private ImmutableList<IContentType> LoadContentTypesIntoLocalCache(int appId, IH
9092 var query = _dbContext . ToSicEavAttributeSets
9193 . Where ( set => set . AppId == appId && set . ChangeLogDeleted == null ) ;
9294
95+ var serializer = _dataDeserializer . New ( ) ;
96+ serializer . Initialize ( appId , new List < IContentType > ( ) , null ) ;
97+
9398 var contentTypes = query
9499 . Include ( set => set . ToSicEavAttributesInSets )
95100 . ThenInclude ( attrs => attrs . Attribute )
@@ -112,7 +117,9 @@ private ImmutableList<IContentType> LoadContentTypesIntoLocalCache(int appId, IH
112117 isTitle : a . IsTitle ,
113118 id : a . AttributeId ,
114119 sortOrder : a . SortOrder ,
115- metaSourceFinder : ( ) => source ) ) ,
120+ metaSourceFinder : ( ) => source ,
121+ guid : a . Attribute . Guid ,
122+ sysSettings : serializer . DeserializeAttributeSysSettings ( a . Attribute . SysSettings ) ) ) ,
116123 IsGhost = set . UsesConfigurationOfAttributeSet ,
117124 SharedDefinitionId = set . UsesConfigurationOfAttributeSet ,
118125 AppId = set . UsesConfigurationOfAttributeSetNavigation ? . AppId ?? set . AppId ,
@@ -142,7 +149,8 @@ private ImmutableList<IContentType> LoadContentTypesIntoLocalCache(int appId, IH
142149 id : a . AttributeId ,
143150 sortOrder : a . SortOrder ,
144151 // Must get own MetaSourceFinder since they come from other apps
145- metaSourceFinder : ( ) => _appStates . Get ( s . AppId ) ) )
152+ metaSourceFinder : ( ) => _appStates . Get ( s . AppId ) ,
153+ sysSettings : serializer . DeserializeAttributeSysSettings ( a . Attribute . SysSettings ) ) )
146154 ) ;
147155 sqlTime . Stop ( ) ;
148156
@@ -177,6 +185,5 @@ private ImmutableList<IContentType> LoadContentTypesIntoLocalCache(int appId, IH
177185
178186 return wrapLog . Return ( newTypes . ToImmutableList ( ) ) ;
179187 }
180-
181188 }
182189}
0 commit comments