Skip to content
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] Error when importing content-types with component field and localization #88

Closed
landoephan opened this issue Dec 8, 2022 · 1 comment
Assignees

Comments

@landoephan
Copy link

Describe the bug
The import doesn't work when I have a content type with a component field and localization enabled.

The error message is error: link must be a object type, but the final value was: '8'

When I disable the localization for that content type the import works. The exported json looks like this:

{
	"version": 2,
	"data": {
		"helpers.portal-link": {
			"8": {
				"id": 8,
				"url": "test",
				"text": "test"
			},
			"10": {
				"id": 10,
				"url": "test",
				"text": "test 2"
			}
		},
		"api::test-with-comp.test-with-comp": {
			"2": {
				"id": 2,
				"createdAt": "2022-12-08T12:51:32.164Z",
				"updatedAt": "2022-12-08T12:53:37.559Z",
				"publishedAt": "2022-12-08T12:51:33.229Z",
				"link": 8,
				"createdBy": null,
				"updatedBy": null
			},
			"3": {
				"id": 3,
				"createdAt": "2022-12-08T12:57:02.387Z",
				"updatedAt": "2022-12-08T12:57:02.387Z",
				"publishedAt": null,
				"link": 10,
				"createdBy": null,
				"updatedBy": null
			}
		}
	}
}

And with the localization activated:

{
	"version": 2,
	"data": {
		"api::test-with-comp.test-with-comp": {
			"4": {
				"id": 4,
				"createdAt": "2022-12-08T13:00:22.485Z",
				"updatedAt": "2022-12-08T13:01:31.555Z",
				"publishedAt": "2022-12-08T13:00:24.717Z",
				"locale": "de",
				"link": 11,
				"localizations": [],
				"createdBy": null,
				"updatedBy": null
			},
			"5": {
				"id": 5,
				"createdAt": "2022-12-08T13:00:33.565Z",
				"updatedAt": "2022-12-08T13:01:31.564Z",
				"publishedAt": "2022-12-08T13:00:34.888Z",
				"locale": "de",
				"link": 12,
				"localizations": [],
				"createdBy": null,
				"updatedBy": null
			}
		},
		"helpers.portal-link": {
			"11": {
				"id": 11,
				"url": "test",
				"text": "test"
			},
			"12": {
				"id": 12,
				"url": "test",
				"text": "test 2"
			}
		}
	}
}

When I remove the component from my content type everything works aswell, no matter if localization is enabled or not.

To Reproduce
Steps to reproduce the behavior:

  1. Create a content-type with localization enabled and a field with a component
  2. create some content for that content-type
  3. export that content using this plugin
  4. import the exported content again
  5. see error

Expected behavior
Data is imported without errors

@Baboo7
Copy link
Owner

Baboo7 commented Apr 23, 2023

@landoephan this issue is fixed in version 1.19.0. Thank you for the detailed report!

@Baboo7 Baboo7 closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants