Commit 68a18acf authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 415544: Mass-change erases all values from custom multi-select fields -…

Bug 415544: Mass-change erases all values from custom multi-select fields - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 2b3d9fb4
...@@ -89,8 +89,7 @@ sub send_results { ...@@ -89,8 +89,7 @@ sub send_results {
$vars->{'header_done'} = 1; $vars->{'header_done'} = 1;
} }
# Tells us whether or not a field should be changed by process_bug, by # Tells us whether or not a field should be changed by process_bug.
# checking that it's defined and not set to dontchange.
sub should_set { sub should_set {
# check_defined is used for fields where there's another field # check_defined is used for fields where there's another field
# whose name starts with "defined_" and then the field name--it's used # whose name starts with "defined_" and then the field name--it's used
...@@ -141,8 +140,11 @@ my $first_bug = $bug_objects[0]; # Used when we're only updating a single bug. ...@@ -141,8 +140,11 @@ my $first_bug = $bug_objects[0]; # Used when we're only updating a single bug.
if (defined $cgi->param('dontchange')) { if (defined $cgi->param('dontchange')) {
foreach my $name ($cgi->param) { foreach my $name ($cgi->param) {
next if $name eq 'dontchange'; # But don't delete dontchange itself! next if $name eq 'dontchange'; # But don't delete dontchange itself!
# Skip ones we've already deleted (such as "defined_$name").
next if !defined $cgi->param($name);
if ($cgi->param($name) eq $cgi->param('dontchange')) { if ($cgi->param($name) eq $cgi->param('dontchange')) {
$cgi->delete($name); $cgi->delete($name);
$cgi->delete("defined_$name");
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment