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] Media (image) set to null after import, even if field is not in imported file #18
Comments
Also its important noticed, when you have more then one level in component. Import are missing populate for media types, I suppose is same problem of new API required specify populate level |
I'm actively working on importing media |
I published version |
Version |
So, Service now should be setup in ./src/extensions? Or need to be setup inside of serve.js from api? In my case I have this sceneario (really similar to what Nicolas describe), {
id: 8,
title: null,
Banner: [ [Object] ],
}, In my case, this Object inside Banner lose everything during import/export process. 😞 |
There is no service to setup (did I misunderstand something?). Version About the objects exported as |
About Setup, sorry maybe I misunderstand documantation. I understand need to configure service now to have better compatibility when export. But thanks to clear, now its fine. About how deep I'm using, let me try example here. {
id: 8,
title: null,
Banner: [{
"id": 1,
"title": "Test 1",
"subtitle": "Subtitle 1",
"buttonText": "Get started",
"buttonHref": "/example",
"styledType": null,
"image": {
"data": {
"id": 300,
"attributes": {
"name": "Frame 341 (1).png",
"alternativeText": "",
"caption": "Frame 341 (1).png",
"width": 524,
"height": 417,
"formats": {
"small": {
"ext": ".png",
"url": "S3bucket.url.here/image1",
"hash": "small_Frame_341_1_fcf6c37756",
"mime": "image/png",
"name": "small_Frame 341 (1).png",
"path": null,
"size": 282.21,
"width": 500,
"height": 398
},
"thumbnail": {
"ext": ".png",
"url": "S3bucket.url.here/image2",
"hash": "thumbnail_Frame_341_1_fcf6c37756",
"mime": "image/png",
"name": "thumbnail_Frame 341 (1).png",
"path": null,
"size": 58.82,
"width": 196,
"height": 156
}
},
"hash": "Frame_341_1_fcf6c37756",
"ext": ".png",
"mime": "image/png",
"size": 59.67,
"url": "S3bucket.url.here/image3",
"previewUrl": null,
"provider": "aws-s3",
"provider_metadata": null,
"createdAt": "2022-07-15T21:11:47.325Z",
"updatedAt": "2022-07-15T21:11:55.599Z"
}
}
},
"icons": {
"data": null
},
"background": {
"data": {
"id": 84,
"attributes": {
"name": "Background_Banner_1.png",
"alternativeText": "Background_Banner_1.png",
"caption": "Background_Banner_1.png",
"width": 1440,
"height": 736,
"formats": {
"large": {
"ext": ".png",
"url": "S3bucket.url.here/background1",
"hash": "large_Background_Banner_1_c2731fcfda",
"mime": "image/png",
"name": "large_Background_Banner_1.png",
"path": null,
"size": 657.12,
"width": 1000,
"height": 511
},
"small": {
"ext": ".png",
"url": "S3bucket.url.here/background2",
"hash": "small_Background_Banner_1_c2731fcfda",
"mime": "image/png",
"name": "small_Background_Banner_1.png",
"path": null,
"size": 174.57,
"width": 500,
"height": 256
},
"medium": {
"ext": ".png",
"url": "S3bucket.url.here/background3",
"hash": "medium_Background_Banner_1_c2731fcfda",
"mime": "image/png",
"name": "medium_Background_Banner_1.png",
"path": null,
"size": 377.97,
"width": 750,
"height": 383
},
"thumbnail": {
"ext": ".png",
"url": "S3bucket.url.here/background4",
"hash": "thumbnail_Background_Banner_1_c2731fcfda",
"mime": "image/png",
"name": "thumbnail_Background_Banner_1.png",
"path": null,
"size": 47.06,
"width": 245,
"height": 125
}
},
"hash": "Background_Banner_1_c2731fcfda",
"ext": ".png",
"mime": "image/png",
"size": 836.74,
"url": "hS3bucket.url.here/background4",
"previewUrl": null,
"provider": "aws-s3",
"provider_metadata": null,
"createdAt": "2022-05-09T18:52:55.167Z",
"updatedAt": "2022-05-09T18:52:55.167Z"
}
}
}
}],
}, |
Version |
Working pretty good now! I mean, when import in:
{
id: 8,
title: null,
Banner: [ [Object] ],
}, Not work =/ Forget to mention, I tested in 1.7.1 version. |
Describe the bug
Everytime we update content by importing data using CSV or JSON, any media field on the root of the schema is set to null, even if the said files doesn't contain the field column
The problem happens even if we let the column with exactly what was exported in the first place (full object or id)
To Reproduce
Expected behavior
Media data is unchanged
The text was updated successfully, but these errors were encountered: