Nuxeo mailing list archives
[CPS-devel] bug in validation of SelectWidget
Miguel Sánchez Beato
miguel.sanchez at iavante.es
Thu Dec 14 17:04:38 CET 2006
Hello people.
I'm Miguel Sánchez and I'm dealing with CPS 3.4.2. I have found a small
bug in the product CPSSchemas:
* When you are using a Select Widget in a layout, and you do not select
the 'required field' option for this widget (that is, you want the
select widget to be optional), the validation of the widget (method
'validate' of the class 'SelectWidget' from the 'BasicWidgets.py'
module) raise an error (cpsschemas_err_select) because it doesn't find
the "selected" value in the vocabulary of the widget, but...I haven't
select any value! it's an optional field!
* This is the code:
...
if not vocabulary.has_key(value):
datastructure.setError(widget_id, "cpsschemas_err_select")
...
* So I fixed it (I think so) writing this:
...
if self.is_required and not vocabulary.has_key(value):
datastructure.setError(widget_id, "cpsschemas_err_select")
...
I don't know whether this bug has been already fixed or not, so if
someone could say something about it, it would help. If it hasn't been
fixed yet, I'll create a ticket in the nuxeo trac as 'tracguest'.
Thank you!
This list archive provided by Nuxeo, the
leaders of open source ECM.
Check out the Nuxeo 5 open source,
standards-based ECM project.