]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 410660: Updating a bug fails if there is a multi-select custom field - Patch...
authorlpsolit%gmail.com <>
Fri, 4 Jan 2008 00:48:23 +0000 (00:48 +0000)
committerlpsolit%gmail.com <>
Fri, 4 Jan 2008 00:48:23 +0000 (00:48 +0000)
Bugzilla/Bug.pm

index 5244a21b3d264669ef00563b112968bb86832d86..bfd110ad055d9b6abca38d23b2257a2a6e40e7b3 100755 (executable)
@@ -1406,8 +1406,15 @@ sub _set_global_validator {
     my ($self, $value, $field) = @_;
     my $current = $self->$field;
     my $privs;
-    $current = $current->id if ref $current && $current->isa('Bugzilla::Object');
-    $value   = $value->id   if ref $value   && $value->isa('Bugzilla::Object');
+
+    if (ref $current && ref($current) ne 'ARRAY'
+        && $current->isa('Bugzilla::Object')) {
+        $current = $current->id ;
+    }
+    if (ref $value && ref($value) ne 'ARRAY'
+        && $value->isa('Bugzilla::Object')) {
+        $value = $value->id ;
+    }
     my $can = $self->check_can_change_field($field, $current, $value, \$privs);
     if (!$can) {
         if ($field eq 'assigned_to' || $field eq 'qa_contact') {