Skip Menu |

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

Report information
The Basics
Id: 116776
Status: rejected
Priority: 0/
Queue: HTML-FormFu

People
Owner: Nobody in particular
Requestors: lautgesetz [...] gmail.com
Cc:
AdminCc:

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



Subject: feature request: way to identify which value in a list caused a constraint violation
I have some form fields that contain comma-delimited list values. These get split into an array and each value is checked against the constraint for the field. As far as I can tell, there is no way to identify, from the HTML::FormFu::Exception object, which of the field values was responsible for the constraint violation. This makes it impossible to provide an error message more specific than "one of the items is wrong (in whatever way)". For longer lists, or subtly invalid input, it would be nice to preserve the association to the input value in the exception object.
Hi, I'm guessing you're currently using a Filter to split the value into an array? In that case, I think you'll need to write a custom Constraint, which will allow you to set the error message directly, using the single value it sees. Alternatively a mechanism could be build into core, that allow the injection of the value into the error message (using sprintf).