]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 538211: Make value-controlled and visibility-controlled fields behave
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 17 Feb 2010 22:07:00 +0000 (14:07 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 17 Feb 2010 22:07:00 +0000 (14:07 -0800)
correctly on enter_bug.cgi when the user uses a bookmarkable template to
pre-fill values in the controller.
r=LpSolit, a=LpSolit

enter_bug.cgi

index debd9dab88b214fdf455b7b1d435d4882d10f1ef..9ea093c8c2e92e4ced22a73e2b83ec5c4e753766 100755 (executable)
@@ -397,7 +397,14 @@ $vars->{'token'}             = issue_session_token('createbug:');
 
 my @enter_bug_fields = grep { $_->enter_bug } Bugzilla->active_custom_fields;
 foreach my $field (@enter_bug_fields) {
-    $vars->{$field->name} = formvalue($field->name);
+    my $cf_name = $field->name;
+    my $cf_value = $cgi->param($cf_name);
+    if (defined $cf_value) {
+        if ($field->type == FIELD_TYPE_MULTI_SELECT) {
+            $cf_value = [$cgi->param($cf_name)];
+        }
+        $default{$cf_name} = $vars->{$cf_name} = $cf_value;
+    }
 }
 
 # This allows the Field visibility and value controls to work with the