KeyError in handleActionError for fields which in a form group
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
z3c.form |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
hi, if i try this in an form with groups, then i get an KeyError:
raise interfaces.
)
email is a widget which is in a group in the form:
class OnlineMemberSig
fields = field.Fields(
groups = (PrimaryContact
i thing here is some thing wrong (handleActionError in form.py):
76: if isinstance(
77: widget = event.action.
event.action.
But maybe there another solution, to have all widgets addressed to event.action.
This solved this problem temporary for me:
widget = None
if isinstance(
widget = event.action.
if not widget:
for group in event.action.
if widget:
do i something wrong, or is this simply a bug?
The ``handleActionE rror()` ` event subscriber was written without groups in mind. And as all code in form.py, it should not handle groups correctly. A similar subscriber should be developed for ``IGroupForm`` implementations that takes groups into consideration as you outline in your workaround above.
The second step would be to make the current event handler resistant against widget lookup failures by catching the KeyError.
I would love to receive a patch for this.