Skip to content

Error in select widget when value is noValueToken #129

@parruc

Description

@parruc

BUG

What I did:

I'm using a single select widget on a choice field populated with a staticcatalog vocabulary and I get an error when saving if the value is not compiled and there is another validation error on the page

What I expect to happen:

Save the content even if the selected value is empty

What actually happened:

Got the following error:

zope.location.interfaces.LocationError: zope.location.interfaces.LocationError: (<SelectWidget 'form.widgets.rubrica'>, 'items')

That actually masks this one:

AttributeError: 'NoneType' object has no attribute 'token'

happening inside

> z3c.form-6.0.1-py3.13.egg/z3c/form/browser/select.py(100)items() -> addItem(idx, term, prefix='missing-')

Because term is None when called on MissingValue

What version of Python and Zope/Addons I am using:

python 3.13.3
Zope 5.13
Plone 6.1.2
z3c.form 6.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions