diff options
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 05f4fec0d..451613e29 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1185,7 +1185,13 @@ foreach my $id (@idlist) { my %formhash; foreach my $col (@::log_columns) { # Consider NULL db entries to be equivalent to the empty string - $oldvalues[$i] = '' unless defined $oldvalues[$i]; + $oldvalues[$i] = defined($oldvalues[$i]) ? $oldvalues[$i] : ''; + # Convert the deadline taken from the DB into the YYYY-MM-DD format + # for consistency with the deadline provided by the user, if any. + # Else CheckCanChangeField() would see them as different in all cases. + if ($col eq 'deadline') { + $oldvalues[$i] = format_time($oldvalues[$i], "%Y-%m-%d"); + } $oldhash{$col} = $oldvalues[$i]; $formhash{$col} = $cgi->param($col) if defined $cgi->param($col); $i++; @@ -1717,6 +1723,10 @@ foreach my $id (@idlist) { foreach my $col (@::log_columns) { # Consider NULL db entries to be equivalent to the empty string $newvalues[$i] ||= ''; + # Convert the deadline to the YYYY-MM-DD format. + if ($col eq 'deadline') { + $newvalues[$i] = format_time($newvalues[$i], "%Y-%m-%d"); + } $newhash{$col} = $newvalues[$i]; $i++; } @@ -1779,16 +1789,6 @@ foreach my $id (@idlist) { $check_dep_bugs = 1; } - # Convert deadlines to the YYYY-MM-DD format. We use an - # intermediate $xxxtime to prevent errors in the web - # server log file when str2time($xxx) is undefined. - if ($col eq 'deadline') { - my $oldtime = str2time($old); - $old = ($oldtime) ? time2str("%Y-%m-%d", $oldtime) : ''; - my $newtime = str2time($new); - $new = ($newtime) ? time2str("%Y-%m-%d", $newtime) : ''; - } - LogActivityEntry($id,$col,$old,$new,$whoid,$timestamp); $bug_changed = 1; } |