You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamic content type builder generates duplicate fields directly to content type. This happens when you register custom content part as typed, when it has fields registered in CMS.
To Reproduce
Steps to reproduce the behavior:
Create a part in CMS with fields, add to Content type
Register custom ObjectGraphType for this part
Open GraphiQL console
View Content type - now it has fields both in registered custom part and directly in content type (as when you collapse part)
Builder already has handling for existing parts. But it does not add missing fields to part. Instead, it adds all fields, even when they are already in part, directly to content type. It checks missing fields against content type instead of content part.
Expected behavior
When custom ObjectGraphType is registered, dynamic builder...
Should not duplicate existing fields and place them directly under content type
Should either do nothing with existing part OR better - it should add only missing fields under given part.
Screenshots
Highlighted props are from dynamic content type builder.
The text was updated successfully, but these errors were encountered:
The one you mention will not fix this issue - if field does not exist in part, it will still add it to base content type
this would need to be handled - add it to part instead of content type. Also not sure if the new GetField method would actually work for getting field from non-collapsed part.
(this issue refers to non-collapsed parts only)
Describe the bug
Dynamic content type builder generates duplicate fields directly to content type. This happens when you register custom content part as typed, when it has fields registered in CMS.
To Reproduce
Steps to reproduce the behavior:
After debugging I think problem is here:
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore/OrchardCore.ContentManagement.GraphQL/Queries/Types/DynamicContentTypeBuilder.cs#L85
Builder already has handling for existing parts. But it does not add missing fields to part. Instead, it adds all fields, even when they are already in part, directly to content type. It checks missing fields against content type instead of content part.
Expected behavior
When custom ObjectGraphType is registered, dynamic builder...
Screenshots
Highlighted props are from dynamic content type builder.
The text was updated successfully, but these errors were encountered: