Widget manager validator for add form has no context

Bug #913987 reported by zjs2k
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
z3c.form
New
Undecided
Unassigned

Bug Description

When register a manager validator by extending z3c.form.validator.InvariantsValidator, the self.context of the validator is always None for an add form. I assume this is not intended, otherwise the context is useless for the validator adapter.

The reason is the add form sets ignoreContext to True. The FieldWidgets.validate checks ignoreContext and set content to None before get the adapter for (content, request, form, schema, manager). I am not sure whether removing the ignoreContext check is the correct solution.

The widget validator does not have the problem because the validator adapter is obtained during FieldWidgets.extract. There is no check for ignoreContext in extract() method.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.