diff --git a/ToSic.Eav.Core/Data/Build/Builder/ContentTypeAttributeBuilder.cs b/ToSic.Eav.Core/Data/Build/Builder/ContentTypeAttributeBuilder.cs index c56c0e934..071bc1a1c 100644 --- a/ToSic.Eav.Core/Data/Build/Builder/ContentTypeAttributeBuilder.cs +++ b/ToSic.Eav.Core/Data/Build/Builder/ContentTypeAttributeBuilder.cs @@ -28,7 +28,7 @@ public ContentTypeAttribute Create( Func metaSourceFinder = null) { metadata = metadata ?? new ContentTypeAttributeMetadata(key: id, name: name, type: type, - sourceGuid: null, items: metadataItems, deferredSource: metaSourceFinder); + sourceGuid: sysSettings?.SourceGuid, items: metadataItems, deferredSource: metaSourceFinder); return new ContentTypeAttribute(appId: appId, name: name, type: type, isTitle: isTitle, attributeId: id, sortOrder: sortOrder, guid: guid, sysSettings: sysSettings, metadata: metadata); diff --git a/ToSic.Eav.Persistence.Efc/Efc11Loader_ContentTypes.cs b/ToSic.Eav.Persistence.Efc/Efc11Loader_ContentTypes.cs index cfc716b6a..35b102036 100644 --- a/ToSic.Eav.Persistence.Efc/Efc11Loader_ContentTypes.cs +++ b/ToSic.Eav.Persistence.Efc/Efc11Loader_ContentTypes.cs @@ -110,21 +110,19 @@ private ImmutableList LoadContentTypesIntoLocalCache(int appId, IH set.Scope, Attributes = set.ToSicEavAttributesInSets .Where(a => a.Attribute.ChangeLogDeleted == null) // only not-deleted attributes! - .Select(a => - { - var nameId = a.Attribute.StaticName; - var valType = ValueTypeHelpers.Get(a.Attribute.Type); - var attributeId = a.AttributeId; - - // #SharedFieldDefinition - var sysSettings = serializer.DeserializeAttributeSysSettings(a.Attribute.SysSettings); - var attrMetadata = new ContentTypeAttributeMetadata(attributeId, nameId, valType, deferredSource: () => source, sourceGuid: sysSettings?.SourceGuid); - - return _dataBuilder.TypeAttributeBuilder - .Create(appId: appId, name: nameId, type: valType, isTitle: a.IsTitle, id: attributeId, sortOrder: a.SortOrder, - // #SharedFieldDefinition - metadata: attrMetadata, guid: a.Attribute.Guid, sysSettings: sysSettings); - }), + .Select(a => _dataBuilder.TypeAttributeBuilder + .Create(appId: appId, + name: a.Attribute.StaticName, + type: ValueTypeHelpers.Get(a.Attribute.Type), + isTitle: a.IsTitle, + id: a.AttributeId, + sortOrder: a.SortOrder, + // #SharedFieldDefinition + // metadata: attrMetadata, + metaSourceFinder: () => source, + guid: a.Attribute.Guid, + sysSettings: serializer.DeserializeAttributeSysSettings(a.Attribute.SysSettings) + )), IsGhost = set.UsesConfigurationOfAttributeSet, SharedDefinitionId = set.UsesConfigurationOfAttributeSet, AppId = set.UsesConfigurationOfAttributeSetNavigation?.AppId ?? set.AppId,