Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTML-FormHandler CPAN distribution.

Report information
The Basics
Id: 54846
Status: resolved
Priority: 0/
Queue: HTML-FormHandler

Owner: Nobody in particular
Requestors: evdb [...]

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

Subject: producing warnings in 'check' sub leads to check failing.
Date: Sun, 21 Feb 2010 15:41:41 -0300
To: bug-HTML-FormHandler <bug-HTML-FormHandler [...]>
From: Edmund von der Burg <evdb [...]>
Download (untitled) / with headers
text/plain 542b
An example has_field 'test' => ( type => 'Text', label => 'Test', apply => [ { check => sub { warn "warning produced"; return 1; }, message => 'check returns true - this message should not be seen', }, ] ); This check will always fail - but comment out the warning and it passes. Not being able to emit warnings in the validation code makes it difficult to debug. Cheers, Edmund. -- Who will you vote for?
Download (untitled) / with headers
text/plain 422b
FormHandler needs to trap warnings in HTML::FormHandler::Validate::Actions::_apply_actions because there are some commonly used validation packages which use 'warn' to indicate an error. I suggest that you use either a 'print' statement or DB::single=1; and step through it with the debugger. It's also easier to test your forms and fields if you use tests such as are found in the FormHandler distribution 't' directory.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to