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
When a content item that was stored in a schema.List field with AjaxSelectFieldWidget and a StaticCatalogVocabulary as vocabulary a missing content item raises:
AttributeError: http://localhost:8080/paediatrics/Plone/team/@@edit
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 376, in publish_module
Module ZPublisher.WSGIPublisher, line 271, in publish
Module ZPublisher.mapply, line 85, in mapply
Module Products.PDBDebugMode.wsgi_runcall, line 60, in pdb_runcall
Module plone.z3cform.layout, line 63, in __call__
Module plone.z3cform.layout, line 47, in update
Module plone.dexterity.browser.edit, line 55, in update
Module plone.z3cform.fieldsets.extensible, line 65, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 141, in update
Module z3c.form.group, line 52, in update
Module z3c.form.group, line 48, in updateWidgets
Module z3c.form.field, line 274, in update
Module plone.app.z3cform.widget, line 441, in update
Module z3c.form.browser.text, line 36, in update
Module z3c.form.browser.widget, line 171, in update
Module Products.CMFPlone.patches.z3c_form, line 46, in _wrapped
Module z3c.form.widget, line 132, in update
Module plone.app.z3cform.converters, line 203, in toWidgetValue
AttributeError: 'NoneType' object has no attribute 'token'
The contract of ITerm says thai getTerm (called intoWidgetValue) it should instead raise a LookupError which can bei either ignored by the DataCoverter or shown.
The text was updated successfully, but these errors were encountered:
I'm not 100% sure if this is the right solution but with the change in #71 only the uuid is displayed when editing:
When saving again a validation-error is shown ("Wrong type for container") which seems correct I think.
But a general question raises it's head here: How do we handle values from vocabularies stored in fields that are no longer valid because these values (be it content or other options) are not longer available?
pbauer
changed the title
StaticCatalogVocabulary with AjaxSelectFieldWidget raises AttributeError on nonexisting value
Field using StaticCatalogVocabulary with AjaxSelectFieldWidget raises AttributeError on nonexisting value
May 13, 2022
When a content item that was stored in a
schema.List
field withAjaxSelectFieldWidget
and aStaticCatalogVocabulary
as vocabulary a missing content item raises:Field example (basically the same as https://github.com/collective/example.contenttype/blob/master/src/example/contenttype/example.py#L660):
The contract of
ITerm
says thaigetTerm
(called intoWidgetValue
) it should instead raise a LookupError which can bei either ignored by the DataCoverter or shown.The text was updated successfully, but these errors were encountered: