Re: Patch for labelfield "validation"

Clemens Klein-Robbenhaar <crobbenhaar-S0/[email protected]> Fri, 22 Apr 2005 23:29:36 +0200
Newsgroups gmane.comp.web.zope.formulator.devel
Message-ID <[email protected]>
Hi Reinout.

> The problem? Ploneformmailer calls validate() directly on every field
> instead of calling the entire form's validation method. Could be done
> better, I suppose. This, however, trips a corner case as it raises a
> KeyError for labelfield: 'external_validator' is missing.
> 
> I've attached a small patch (including an extra unittest) for the
> latest version from CVS. 
[...]

Oh, great, a patch with a test :)

Added to the CVS. I felt so free to add a "enable=0" to the
new "external_validator" field, so it does not show up in the ZMI
of the LabelField. The drawback is that now the patch
only works on new LabelFields, not already existing ones.

  The workaround in that case is to enable the field temporarily,
save all LabelFields, and then disable it again ... or just leave
it enabled.
  I hope this is acceptable, compared to having a completely unfunctional
Filed in the ZMI

Cheers,
Clemens