From a43231dd4ccef2b02fa0434217b637a6d1638c97 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 3 Oct 2008 06:40:15 +0000 Subject: Bug 456922: Now that Bugzilla::Field::Choice is complete, clean up editvalues.cgi and error messages Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- Bugzilla/Field/Choice.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Bugzilla/Field') diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index a5c5fe6b1..dbdfea1a3 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -174,18 +174,17 @@ sub remove_from_db { my $self = shift; if ($self->is_default) { ThrowUserError('fieldvalue_is_default', - { field => $self->field, value => $self->name, + { field => $self->field, value => $self, param_name => $self->DEFAULT_MAP->{$self->field->name}, }); } if ($self->is_static) { ThrowUserError('fieldvalue_not_deletable', - { field => $self->field, value => $self->name }); + { field => $self->field, value => $self }); } if ($self->bug_count) { ThrowUserError("fieldvalue_still_has_bugs", - { field => $self->field, value => $self->name, - count => $self->bug_count }); + { field => $self->field, value => $self }); } $self->SUPER::remove_from_db(); } @@ -272,7 +271,7 @@ sub _check_value { && $invocant->is_static) { ThrowUserError('fieldvalue_not_editable', - { field => $field, old_value => $invocant->name }); + { field => $field, old_value => $invocant }); } ThrowUserError('fieldvalue_undefined') if !defined $value || $value eq ""; @@ -282,7 +281,7 @@ sub _check_value { my $exists = $invocant->type($field)->new({ name => $value }); if ($exists && (!blessed($invocant) || $invocant->id != $exists->id)) { ThrowUserError('fieldvalue_already_exists', - { field => $field, value => $value }); + { field => $field, value => $exists }); } return $value; -- cgit v1.2.3-24-g4f1b