collective / collective/collective.exportimport

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

Open
#138 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
19
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in import_content.py at import_new_content(), especially the deserializer call shown in the traceback. Reproduce the unresolved RelationChoice case and trace how the deserialization error interrupts later processing. Done means an unresolvable reference does not prevent the object’s subsequent processing, including setting its review state to published.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.