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

relatedItems -> zExceptions.BadRequest: [{'message': 'Required input is missing.', 'field': 'relatedItems', 'error': RequiredMissing('')}] #738

Closed
zopyx opened this issue May 31, 2019 · 2 comments · Fixed by #756

Comments

@zopyx
Copy link
Member

commented May 31, 2019

plone.restapi 4.0.0

Creating a new document with this data gives me an error.

The error message is not consistent with the data used.

This might be a side effect of the fact that the given list of UIDs does not exist as content object inside the Plone site (e.g. some referenced content is not imported during a migration).

{'@type': 'Document',
 'contributors': [],
 'creators': ['tbrissin'],
 'description': 'Via deze pagina kunt u solliciteren voor statutaire '
                'ZAP-posities aan de Universiteit Gent.',
 'excludeFromNav': True,
 'id': 'overzicht.htm',
 'language': 'nl',
 'location': '',
 'relatedItems': ['eb972ac2ab854f5685d6cc99cda6eab4',
                  '89fda10a5f234ba3bd87bdcbe03151b0',
                  '278ee35ad8da49ecb2a7b0c78b40adda',
                  'e6fd07eb55da4fd6bb489905ec937760'],
 'subject': [],
 'title': 'ZAP-vacatures statutair'}

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 142, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 295, in publish_module
  Module ZPublisher.WSGIPublisher, line 229, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 57, in call_object
  Module plone.rest.service, line 23, in __call__
  Module plone.restapi.services, line 19, in render
  Module plone.restapi.services.content.add, line 70, in reply
  Module plone.restapi.deserializer.dxcontent, line 129, in __call__
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 142, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 295, in publish_module
  Module ZPublisher.WSGIPublisher, line 229, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 57, in call_object
  Module plone.rest.service, line 23, in __call__
  Module plone.restapi.services, line 19, in render
  Module plone.restapi.services.content.add, line 70, in reply
  Module plone.restapi.deserializer.dxcontent, line 129, in __call__
zExceptions.BadRequest: [{'message': 'Required input is missing.', 'field': 'relatedItems', 'error': RequiredMissing('')}]


@tisto tisto added the 01 type: bug label Jun 2, 2019
@tisto

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

@zopyx just to understand this correctly. You are pushing a document that contains UIDs in the relatedItems attribute that do not exist, correct?

I'd expect plone.restapi to raise an exception (with a better error message of course), do you agree?

@zopyx

This comment has been minimized.

Copy link
Member Author

commented Jun 2, 2019

@zopyx just to understand this correctly. You are pushing a document that contains UIDs in the relatedItems attribute that do not exist, correct?

correct - because as part of a migration you can only set all relatedItems properly after all content is in place.

I'd expect plone.restapi to raise an exception (with a better error message of course), do you agree?

There should be an error like "Object(s) referenced through UID/IntID/ .... could not be resolved/not found"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.