Mass-change erases all values from custom multi-select fields

RESOLVED FIXED in Bugzilla 3.2

Status

()

Bugzilla
Creating/Changing Bugs
--
critical
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

({dataloss, regression})

3.1.3
Bugzilla 3.2
dataloss, regression
Bug Flags:
approval +
blocking3.2 +

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
I don't know what regressed it, but doing a mass-change deletes all values already set to multi-select fields, even with --do_not_change--.
Flags: blocking3.2+
(Assignee)

Comment 1

10 years ago
Created attachment 301373 [details] [diff] [review]
patch, v1

$cgi->param('defined_foo') must be deleted if $cgi->param('foo') eq '--do_not_change--' else process_bug.cgi sees that as a wish to clear the 'foo' field.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #301373 - Flags: review?(mkanat)

Comment 2

10 years ago
Comment on attachment 301373 [details] [diff] [review]
patch, v1

>+        # Ignore defined_$name if param($name) eq dontchange.
>+        next if !defined $cgi->param($name);

  Wait, that doesn't seem to do what the comment above states...?
(Assignee)

Comment 3

10 years ago
(In reply to comment #2)
>   Wait, that doesn't seem to do what the comment above states...?

It does. When cf_<multi_select_name> eq 'dontchange', we delete defined_cf_<multi_select_name> else we are going to erase everything. So when we encounter defined_cf_<multi_select_name> in the foreach loop (foreach my $name ($cgi->param)), we have to skip it as it has already been deleted, and so $cgi->param('defined_cf_<multi_select_name>') is undefined. Else we get an error about an uninitialized value when doing the 'eq' comparison.

Comment 4

10 years ago
Comment on attachment 301373 [details] [diff] [review]
patch, v1

Ah, I get it now.

On checkin, change the comment to:

# Skip ones we've already deleted (such as "defined_$name").
Attachment #301373 - Flags: review?(mkanat) → review+

Updated

10 years ago
Flags: approval+
(Assignee)

Comment 5

10 years ago
I fixed the comment on checkin:

Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.404; previous revision: 1.403
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.