From: Frédéric Buclin Date: Thu, 14 Nov 2013 23:04:15 +0000 (+0100) Subject: Bug 927900: Kill longdesclength X-Git-Tag: bugzilla-4.5.2~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cf4971f32fe1fffb3919c9a459e92f6a2c0ca02;p=thirdparty%2Fbugzilla.git Bug 927900: Kill longdesclength r=dkl a=sgreen --- diff --git a/email_in.pl b/email_in.pl index 183833008b..03db450f7a 100755 --- a/email_in.pl +++ b/email_in.pl @@ -251,7 +251,6 @@ sub process_bug { foreach my $field (keys %fields) { $cgi->param(-name => $field, -value => $fields{$field}); } - $cgi->param('longdesclength', scalar @{ $bug->comments }); $cgi->param('token', issue_hash_token([$bug->id, $bug->delta_ts])); require 'process_bug.cgi'; diff --git a/process_bug.cgi b/process_bug.cgi index 90e363afa0..ed1a19203a 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -122,16 +122,14 @@ if ($delta_ts) { if ($first_delta_tz_z ne $delta_ts_z) { ($vars->{'operations'}) = $first_bug->get_activity(undef, $delta_ts); - my $start_at = $cgi->param('longdesclength') - or ThrowCodeError('undefined_field', { field => 'longdesclength' }); - # Always sort midair collision comments oldest to newest, # regardless of the user's personal preference. - my $comments = $first_bug->comments({ order => "oldest_to_newest" }); + my $comments = $first_bug->comments({ order => 'oldest_to_newest', + after => $delta_ts }); # Show midair if previous changes made other than CC # and/or one or more comments were made - my $do_midair = scalar @$comments > $start_at ? 1 : 0; + my $do_midair = scalar @$comments ? 1 : 0; if (!$do_midair) { foreach my $operation (@{ $vars->{'operations'} }) { @@ -147,7 +145,6 @@ if ($delta_ts) { if ($do_midair) { $vars->{'title_tag'} = "mid_air"; - $vars->{'start_at'} = $start_at; $vars->{'comments'} = $comments; $vars->{'bug'} = $first_bug; # The token contains the old delta_ts. We need a new one. diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 61d1c67e07..a2fe4e52ff 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -44,26 +44,16 @@ //--> -[% DEFAULT start_at = 0 mode = "show" %] -[% sort_order = user.settings.comment_sort_order.value %] +[% DEFAULT mode = "show" %] [% user_cache = template_cache.users %] -[%# NOTE: (start_at > 0) means we came here from a midair collision, - # in which case we don't care what the user's preference is. - %] -[% IF (start_at > 0) %] - [% sort_order = "oldest_to_newest" %] -[% END %] -
[% FOREACH comment = comments %] - [% IF comment.count >= start_at %] - [% PROCESS a_comment %] - [% END %] + [% PROCESS a_comment %] [% END %] [% IF mode == "edit" && user.id diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 8d38152fdd..acdcdbf7aa 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -46,7 +46,6 @@
- diff --git a/template/en/default/bug/process/midair.html.tmpl b/template/en/default/bug/process/midair.html.tmpl index 684b996390..17025fee74 100644 --- a/template/en/default/bug/process/midair.html.tmpl +++ b/template/en/default/bug/process/midair.html.tmpl @@ -11,10 +11,6 @@ # used by bug/activity/table.html.tmpl to display recent changes that will # be overwritten if the user submits these changes. See that template # for further documentation. - # start_at: number; the comment at which show/comments.tmpl should begin - # displaying comments, either the index of the last comment (if the user - # entered a comment along with their change) or a number less than that - # (if they didn't), in which case no comments are displayed. # comments: array; all the comments on the bug. # bug: Bugzilla::Bug; the bug being changed. #%] @@ -40,7 +36,7 @@ [% PROCESS "bug/activity/table.html.tmpl" incomplete_data=0 %]

-[% IF comments.size > start_at %] +[% IF comments.size %]

Added the comment(s):

@@ -71,7 +67,7 @@ You have the following choices: exclude="^Bugzilla_login|Bugzilla_password|delta_ts$" %] This will cause all of the above changes to be overwritten - [% ", except for the added comment(s)" IF comments.size > start_at %]. + [% ", except for the added comment(s)" IF comments.size %]. [% IF cgi.param("comment") %] @@ -82,7 +78,6 @@ You have the following choices: -