volto icon indicating copy to clipboard operation
volto copied to clipboard

Problem with CatalogSource RelationChoice fields

Open tiberiuichim opened this issue 3 years ago • 1 comments

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"
      }
    },

tiberiuichim avatar Aug 08 '21 05:08 tiberiuichim

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

tiberiuichim avatar Jul 16 '22 05:07 tiberiuichim