Skip Menu |

This queue is for tickets about the Brannigan CPAN distribution.

Report information
The Basics
Id: 59636
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Brannigan

People
Owner: IDOPEREL [...] cpan.org
Requestors: RSAVAGE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.5
Fixed in: (no value)



Subject: Required and supplied parameter rejected if value is 0
Hi Code and output: #!/usr/bin/perl use common::sense; use Brannigan; # ------------ my($validator) = Brannigan -> new ({ name => 'content', params => { action => { required => 1, value_between => [0, 3], }, }, }); my($data) = { action => 0, }; for (sort keys %$data) { print "Data: $_ => $$data{$_}. length(", length($$data{$_}), "). \n"; } print "\n"; my($result) = $validator -> process('content', $data); for (keys %$result) { print "Result: $_ => $$result{$_}. \n"; } print "\n"; for (keys %{$$result{_rejects} }) { print "Reject: $_ => ", join(', ', @{$$result{_rejects}{$_} }), ". \n"; } ron@zephyr:~$ ./x.pl Data: action => 0. length(1). Result: _rejects => HASH(0x81d54c0). Result: action => 0. Reject: action => required(1). I tried tracing thru the code, but gave up :-(.
Fixed in version 0.6, live on CPAN in a few hours. Thanks for reporting the bug.