summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-01-02 23:52:25 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2014-01-02 23:52:25 +0100
commitfc5aae4091324a630fee712984b1a643e45e3197 (patch)
tree875ad72d73354d68c2a03629ec3fcd3a819685cf
parent3af2a748f631ca349daee12f7c3c26a8fb831219 (diff)
downloadbugzilla-fc5aae4091324a630fee712984b1a643e45e3197.tar.gz
bugzilla-fc5aae4091324a630fee712984b1a643e45e3197.tar.xz
Bug 895813: Mandatory custom fields whose visibility depends on a component are not required on bug creation
r=pketolai r=dkl a=sgreen
-rw-r--r--Bugzilla/Component.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm
index d8f75daae..3d56cc8c2 100644
--- a/Bugzilla/Component.pm
+++ b/Bugzilla/Component.pm
@@ -413,10 +413,10 @@ use constant is_default => 0;
sub is_set_on_bug {
my ($self, $bug) = @_;
- # We treat it like a hash always, so that we don't have to check if it's
- # a hash or an object.
- return 0 if !defined $bug->{component_id};
- $bug->{component_id} == $self->id ? 1 : 0;
+ my $value = blessed($bug) ? $bug->component_id : $bug->{component};
+ $value = $value->id if blessed($value);
+ return 0 unless $value;
+ return $value == $self->id ? 1 : 0;
}
###############################