Last Comment Bug 591218 - "Form field longdesclength was not defined" error while mid-airing again after clicking "Submit only my new comment" on mid-air page
: "Form field longdesclength was not defined" error while mid-airing again afte...
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Creating/Changing Bugs (show other bugs)
: 3.6.2
: All All
: -- normal (vote)
: Bugzilla 3.6
Assigned To: Reed Loden [:reed] (use needinfo?)
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-27 03:45 PDT by Reed Loden [:reed] (use needinfo?)
Modified: 2010-08-28 01:39 PDT (History)
4 users (show)
mkanat: approval+
mkanat: approval4.0+
mkanat: approval3.6+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch - v1 (808 bytes, patch)
2010-08-27 03:49 PDT, Reed Loden [:reed] (use needinfo?)
mkanat: review+
Details | Diff | Review

Description Reed Loden [:reed] (use needinfo?) 2010-08-27 03:45:00 PDT
If you select the "Submit only my new comment" button on the mid-air page and encounter yet another mid-air, you will receive a "Form field longdesclength was not defined" error.

From template/en/default/bug/process/midair.html.tmpl:
  [% IF cgi.param("comment") %]
    <li>
      <form method="post" action="process_bug.cgi">
        <input type="hidden" name="id" value="[% cgi.param("id") FILTER html %]">
        <input type="hidden" name="delta_ts" value="[% bug.delta_ts FILTER html %]">
        <input type="hidden" name="comment" value="[% cgi.param("comment") FILTER html %]">
        <input type="hidden" name="commentprivacy" value="[% cgi.param("commentprivacy") FILTER html %]">
        <input type="hidden" name="token" value="[% cgi.param("token") FILTER html %]">
        <input type="submit" id="process_comment" value="Submit only my new comment">
      </form>
    </li>
  [% END %]

From process_bug.cgi:
if (defined $cgi->param('delta_ts'))
{
    my $delta_ts_z = datetime_from($cgi->param('delta_ts'));
    my $first_delta_tz_z =  datetime_from($first_bug->delta_ts);
    if ($first_delta_tz_z ne $delta_ts_z) {
        ($vars->{'operations'}) =
            Bugzilla::Bug::GetBugActivity($first_bug->id, undef,
                                          scalar $cgi->param('delta_ts'));

        $vars->{'title_tag'} = "mid_air";

        ThrowCodeError('undefined_field', { field => 'longdesclength' })
            if !defined $cgi->param('longdesclength');
...


Obvious fix would be to add 'longdesclength' to the "Submit only my new comment" form. However, it would be better to just skip the mid-air check code completely, as we already know the user wants to continue anyway... Thoughts?
Comment 1 Reed Loden [:reed] (use needinfo?) 2010-08-27 03:49:15 PDT
Created attachment 469831 [details] [diff] [review]
patch - v1

Obvious fix, but not the right fix, imho...
Comment 2 Max Kanat-Alexander 2010-08-27 11:08:25 PDT
Comment on attachment 469831 [details] [diff] [review]
patch - v1

Well, this is a reasonable fix for the branches, and I'm okay with having it on trunk too.

I'm okay with getting double-midairs. I mean, maybe somebody else already said what you're about to say, or fixed what you're about to fix.
Comment 3 Reed Loden [:reed] (use needinfo?) 2010-08-28 01:39:38 PDT
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/bug/process/midair.html.tmpl
Committed revision 7449.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/
modified template/en/default/bug/process/midair.html.tmpl
Committed revision 7385.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/
modified template/en/default/bug/process/midair.html.tmpl
Committed revision 7165.

Note You need to log in before you can comment on or make changes to this bug.