summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Field
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-10-03 08:40:15 +0200
committermkanat%bugzilla.org <>2008-10-03 08:40:15 +0200
commita43231dd4ccef2b02fa0434217b637a6d1638c97 (patch)
tree5d5f7987c0216ca2d2fe931cd9b7cbc879a34502 /Bugzilla/Field
parentb03fc56082401474044c7f92f8786164ca0508a4 (diff)
downloadbugzilla-a43231dd4ccef2b02fa0434217b637a6d1638c97.tar.gz
bugzilla-a43231dd4ccef2b02fa0434217b637a6d1638c97.tar.xz
Bug 456922: Now that Bugzilla::Field::Choice is complete, clean up editvalues.cgi and error messages
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat
Diffstat (limited to 'Bugzilla/Field')
-rw-r--r--Bugzilla/Field/Choice.pm11
1 files changed, 5 insertions, 6 deletions
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;