Re: [dfv] missing_optional_valid ?
Status: Inactive
Brought to you by:
markjugg
|
From: Louis-David M. <vin...@ap...> - 2010-12-09 16:54:32
|
On Thu, Dec 09, 2010 at 11:49:30AM -0500, Mark Stosberg wrote:
> On 12/09/2010 10:30 AM, Louis-David Mitterrand wrote:
> > On Thu, Dec 09, 2010 at 10:24:03AM -0500, Mark Stosberg wrote:
> >> On 12/09/2010 04:53 AM, Louis-David Mitterrand wrote:
> >>> Hi,
> >>>
> >>> When using the $profile below, the 'missing_optional_valid' entries are
> >>> never included in the valid hash. Specifically the notify_* checkboxes
> >>> in require_some are never returned when unchecked. Did I miss something?
> >>
> >> What happens if you add all of the "require_some" fields explicitly to
> >> an "optional" definition?
> >
> > Then it works, but only if I also add:
> >
> > defaults_regexp_map => {
> > qr/^notify_/ => 0,
> > },
> >
> > Shouldn't the 'require_some' values that are not actually required (as
> > per submit) be auto-added to 'optional'?
>
> Not necessarily. There are two cases for one could intend "require_some"
> to be used:
>
> - At least one of five fields is required. We do not care about fields
> which are not submitted. Either they are required are they are not in
> the profile.
>
> - At least one of five fields is required. We would still like the
> non-required fields to be returned as valid.
>
> I think it's reasonable to add require_some entires to optional if you
> want them all through as "valid".
OK, fair enough. But why do I have to add a 'defaults_regexp_map' in
order to get my missing optionnals in the 'valid' hash? Shouldn't the
'missing_optional_valid' parameter do that? (notify_* are checkboxes)
|