From a806b298f5bfe5914f27a1419d27366fe59da449 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 9 Sep 2006 06:11:40 +0000 Subject: Bug 287326: Ability to add custom single-select fields to a bug - Patch by Frédéric Buclin and Max Kanat-Alexander r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Object.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Object.pm') diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 8de20d5f3..5d80a9d0f 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -17,6 +17,7 @@ # Everything Solved. All Rights Reserved. # # Contributor(s): Max Kanat-Alexander +# Frédéric Buclin use strict; @@ -136,7 +137,7 @@ sub set { my $validators = $self->VALIDATORS; if (exists $validators->{$field}) { my $validator = $validators->{$field}; - $value = $self->$validator($value); + $value = $self->$validator($value, $field); } $self->{$field} = $value; @@ -196,7 +197,7 @@ sub run_create_validators { my $value; if (exists $validators->{$field}) { my $validator = $validators->{$field}; - $value = $class->$validator($params->{$field}); + $value = $class->$validator($params->{$field}, $field); } else { $value = $params->{$field}; @@ -328,6 +329,9 @@ a reference to the current object (what we normally call C<$self>). The second argument will be the value passed to L or Lfor that field. +The third argument will be the name of the field being validated. +This may be required by validators which validate several distinct fields. + These functions should call L if they fail. The validator must return the validated value. -- cgit v1.2.3-24-g4f1b