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

Content importer does not deal correctly with unresolvable references and omits further (necessary processing steps) #138

Open
zopyx opened this issue Jun 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@zopyx
Copy link
Contributor

zopyx commented Jun 16, 2022

We have content-types that contains a RelationChoice field with a value like

related_url': '/community/meinung/onlineangebote-lehramtsstudium'

The referenced object has not been imported yet. So this reference is not resolvable. For this reason, the deserializer throws an error

> /Users/ajung/src/plone6.buildout/src/collective.exportimport/src/collective/exportimport/import_content.py(366)import_new_content()
-> new = deserializer(validate_all=False, data=item)
(Pdb) 
zExceptions.BadRequest: [{'message': 'Could not resolve object for path=/community/meinung/onlineangebote-lehramtsstudium', 'field': 'related_url', 'error': 'ValidationError'}]

and stops with the further processing on the object. E.g. the review state of this object is then not correctly set (and remains in private rather than published state).

@zopyx
Copy link
Contributor Author

zopyx commented Jun 16, 2022

Removing continue in https://github.com/collective/collective.exportimport/blob/main/src/collective/exportimport/import_content.py#L368 resolves the problem for us...perhaps it is the solution since the import of relations is usually done at the end of a migration import.

@zopyx
Copy link
Contributor Author

zopyx commented Jun 16, 2022

Alternatively, the deserializer check could be made optional (through a parameter or environment variable).

@zopyx zopyx added the bug Something isn't working label Jun 16, 2022
@zopyx zopyx changed the title Content importer does not deal correctly with unresolvable references Content importer does not deal correctly with unresolvable references and omits further (necessary processing steps) Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant