-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] repeatable component with nested component that contains a relation is not transformed #99
Labels
bug
Something isn't working
Comments
I cannot reproduce this issue on the latest strapi version with the provided information. The data is transformed correctly with the data and attributes keys removed. Can you provide the full schema files for all related content types/components? This should make it easier to reproduce. |
// src/api/memorial/content-types/memorial/schema.json
{
"kind": "collectionType",
"collectionName": "memorials",
"info": {
"singularName": "memorial",
"pluralName": "memorials",
"displayName": "Memorials",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"size": {
"type": "component",
"repeatable": true,
"component": "record.razmer-s-fiksirovannoj-czenoj-3-d", // component with nested component
"required": true
}
}
} // src/api/additional-product/content-types/additional-product/schema.json
{
"kind": "collectionType",
"collectionName": "additional_products",
"info": {
"singularName": "additional-product",
"pluralName": "additional-products",
"displayName": "Additional products",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string",
"required": true
}
}
} // src/components/record/razmer-s-fiksirovannoj-czenoj-3-d.json
{
"collectionName": "components_record_razmer_s_fiksirovannoj_czenoj_3_ds",
"info": {
"displayName": "Memorial size",
"description": ""
},
"options": {},
"attributes": {
"length": {
"type": "integer",
"required": true,
"min": 0
},
"width": {
"type": "integer",
"required": true,
"min": 0
},
"height": {
"type": "integer",
"required": true,
"min": 0
},
"price": {
"type": "decimal",
"required": true,
"min": 0
},
"additionalProducts": {
"type": "component",
"repeatable": false,
"component": "memorial.obyazatelnye-dop-tovary", // problem nested component
"required": true
}
}
} // src/components/memorial/obyazatelnye-dop-tovary.json
{
"collectionName": "components_memorial_obyazatelnye_dop_tovary",
"info": {
"displayName": "Required additional products"
},
"options": {},
"attributes": {
"stand": {
"type": "relation",
"relation": "oneToOne",
"target": "api::additional-product.additional-product" // Objects from this collection not transformed
}
}
} |
Thanks for the schema! I was able to reproduce this issue and will look into fixing it. |
ComfortablyCoding
changed the title
Data and attributes inside relations in a component field are not deleted
[BUG] repeatable component with nested component that contains a relation is not transformed
Jan 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relation type "oneToOne".
Response example:
The text was updated successfully, but these errors were encountered: