volto
volto copied to clipboard
Problem with CatalogSource RelationChoice fields
I have a content type field defined as:
partner= RelationChoice(source=CatalogSource(portal_type='Partner'))
In Volto edit form there's a request made to http://localhost:3000/@vocabularies/http://localhost:3000/@sources/partner?b_start=0
The schema is serialized like:
"partner": {
"behavior": "IHasPartner",
"description": "",
"factory": "Relation Choice",
"title": "Partner",
"type": "string",
"vocabulary": {
"@id": "http://localhost:3000/@sources/partner"
}
},
There's multiple problems here:
-
@sources
calls should be rooted in the context, rather then the root - the
@sources
call would be useless in the case of the add form, so we need something like a "portal factory" or to pass additional information to the sources call, to provide the "future type" info, so that it can be built in the@sources
service