You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module plone.rest.service, line 23, in __call__
Module plone.restapi.services, line 19, in render
Module plone.restapi.services.types.get, line 53, in reply
Module plone.restapi.types.utils, line 206, in get_jsonschema_for_portal_type
Module plone.restapi.types.utils, line 175, in get_jsonschema_for_fti
Module plone.restapi.types.utils, line 141, in get_tagged_values
AttributeError: 'str' object has no attribute 'params'
Having a type with a schema defining the following field:
and requesting:
curl -H "Accept: application/json" --user "admin:admin" "http://localhost:8080/Plone/@types/MyType
will raise the following error:
Problem
To set a widget of a field, you'll use
plone.autoform
swidget
-directive (https://github.com/plone/plone.autoform/blob/master/plone/autoform/directives.py#L76). If you take a closer look at this function, you'll see, that there are two different possibilities, how to set a widget.The first on is to pass keyword-args
The second is to pass positional-args:
Using positional-args will create a
ParameterizedWidget
-factory (https://github.com/plone/plone.autoform/blob/master/plone/autoform/directives.py#L137). Using the keyword-args will generate a string to identify the widget (https://github.com/plone/plone.autoform/blob/master/plone/autoform/directives.py#L129).The
get_tagged_values
-function will fail (https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/types/utils.py#L142) if you set a widget through keyword-args, because this function assumes aParametrizedWidget
factory.The text was updated successfully, but these errors were encountered: