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
{{ message }}
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
Import filter for canImport -> contentType is not working as expected.
What went wrong?
I want the contentTypes import to work for a given Content Type only. However, the import flow ignores all contentTypes completely.
Repro steps
Select a zip of project containing multiple content types.
Create a new import service with config: canImport: { contentType: item => { if (item.codename === 'codename_of_one_content_type_in_your_project') { // content type will be imported only if the codename is equal to 'n020_app_ui_string' return true } // all other types will be excluded from import return false }, ... }
Try importing using Import Service with above config
See that this importService skips all content types completely.
Expected behavior
The import service should import the content type specified in the config.
What the correct behavior is?
The import service should import the content type specified in the config.
Test environment
Tested this via GitHub actions by creating a custom action using typescript.
Additional context
Add any other context about the problem here.
Screenshots
The text was updated successfully, but these errors were encountered:
In case of your config only a single content type with codename codename_of_one_content_type_in_your_project would be imported. All other types should be ignored which is expected behavior based on this configuration.
In case of your config only a single content type with codename codename_of_one_content_type_in_your_project would be imported. All other types should be ignored which is expected behaviour based on this configuration.
This behaviour mentioned is exactly what I want. However, what is actually happening is content types are being skipped out completely. The content type with codename: codename_of_one_content_type_in_your_project is also being skipped for some reason even though the config returns true.
What I found while debugging was on line 293 of the screenshot in the issue, the contentTypes list is getting emptied out in the first loop(from line 290) itself. Probably because id field does not exist on m / item .
I see what is going on. The skip action was moved to section after translating ids and therefore the id property was no longer there. I've moved it back and it should be working well now :) It's been released in 4.0.1. Thanks for letting us know!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Brief bug description
Import filter for
canImport -> contentType
is not working as expected.What went wrong?
I want the contentTypes import to work for a given Content Type only. However, the import flow ignores all contentTypes completely.
Repro steps
canImport: { contentType: item => { if (item.codename === 'codename_of_one_content_type_in_your_project') { // content type will be imported only if the codename is equal to 'n020_app_ui_string' return true } // all other types will be excluded from import return false }, ... }
Expected behavior
The import service should import the content type specified in the config.
What the correct behavior is?
The import service should import the content type specified in the config.
Test environment
Tested this via GitHub actions by creating a custom action using typescript.
Additional context
Add any other context about the problem here.
Screenshots
The text was updated successfully, but these errors were encountered: