volto
volto copied to clipboard
RelationChoice field ObjectBrowserWidget first selection
Describe the bug The ObjectBrowserWidget gives an error when you choose the first object in a RelationChoice field
To Reproduce Steps to reproduce:
We have configured a RelationChoice field in the backend this way:
<field name="authors" type="z3c.relationfield.schema.RelationList">
<title i18n:translate="">Authors</title>
<description i18n:translate=""></description>
<value_type type="z3c.relationfield.schema.RelationChoice">
<title>Related</title>
<portal_type>
<element>Author</element>
</portal_type>
</value_type>
<required>False</required>
<readonly>False</readonly>
</field>
In the frontend, when we choose an object for this field, breaks in this line: https://github.com/plone/volto/blob/a03d73ac33d1a09b5531ea9bb0fdd67d7415c023/src/components/manage/Widgets/ObjectBrowserWidget.jsx#L151
Should we check if this.props.value
is not null to be sure that we can spread it?
Related to https://github.com/plone/volto/issues/3355 ?
@ionlizarazu has this been fixed in #3355?
Yes, it has been fixed. Thanks!