From 4ab6c90fff265849d9284b5d4f9aca93da231edd Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 24 Sep 2008 07:55:05 +0000 Subject: Bug 357904: Create an object for a Field Value and have Bugzilla::Field->legal_values use it Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- Bugzilla/Object.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Object.pm') diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index d616bb2da..bcd436484 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -63,7 +63,10 @@ sub _init { my $name_field = $class->NAME_FIELD; my $id_field = $class->ID_FIELD; - my $id = $param unless (ref $param eq 'HASH'); + my $id = $param; + if (ref $param eq 'HASH') { + $id = $param->{id}; + } my $object; if (defined $id) { @@ -511,7 +514,9 @@ as the value in the L column). If you pass in a hashref, you can pass a C key. The value of the C key is the case-insensitive name of the object -(from L) in the DB. +(from L) in the DB. You can also pass in an C key +which will be interpreted as the id of the object you want (overriding the +C key). B -- cgit v1.2.3-24-g4f1b