Widget manager validator for add form has no context

Bug #913987 reported by zjs2k on 2012-01-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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  Edit
Everyone can see this information.

Other bug subscribers