zope.formlib does not correctly validate invariants with fields from a base interface.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Fix Released
|
Undecided
|
Unassigned | ||
Zope 3 |
Won't Fix
|
Undecided
|
Unassigned | ||
zope.formlib |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Example:
>>> import zope.interface
>>> import zope.schema
>>> class IBase(zope.
... title = zope.schema.
... title=u"Title",
... required=False)
>>> class ISub(IBase):
... sub_title = zope.schema.
... title=u"Subtitle",
... required=False)
...
... @zope.interface
... def title_or_
... if not (obj.title or obj.sub_title):
... raise zope.interface.
... u"Set either title or subtitle.")
When validating an object (using zope.formlib.
Is there any reason for this behavior? There is no test for this behavior.
Suggestion:
If there is no specific reason for this behavior, the invariant should get all the form field data from the request.
Changed in zope3: | |
status: | New → Won't Fix |
Changed in zope.formlib: | |
status: | New → Fix Released |
This bug was already fixed in zope.formlib 3.4.0 r69738 by srichter. Unfortunately, Zope 2.10 uses an older version. In Zope 2.11, the bug is fixed.