Testopia 2 - cannot save test plan

RESOLVED FIXED

Status

RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: bradh, Assigned: gregaryh)

Tracking

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.8 (like Gecko)
Build Identifier: CVS

Testopia wouldn't create a test plan for me - the entry screen popped up, 
but the screen wouldn't save (clicking on the left hand button had no effect).

I think it is related to this error:
[Wed Feb 20 21:43:28 2008] [error] [client 127.0.0.1] Bareword "ERROR_MODE_AJAX" not allowed while "strict subs" in use at /var/www/bugzilla-3.0.3/tr_list_plans.cgi line 41., referer: 
http://localhost/bugzilla/tr_show_product.cgi

A fix went into the testopia patch (i.e. testopia/patch-3.0), but it didn't
appear to work for me.

Possibly there is a typo in it? The error in my logs is ERROR_MODE_AJAX,
but the patch adds ERROR_MODE_DIE_AJAX. See:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/webtools/testopia/testopia&command=DIFF_FRAMESET&file=patch-3.0&rev1=1.7&rev2=1.8&root=/cvsroot

If I change the patch to add ERROR_MOD_AJAX, I can get a bit further.
--- ../bugzilla-3.0.3-orig/Bugzilla/Constants.pm        2008-02-20 19:31:56.000000000 +1100
+++ Bugzilla/Constants.pm       2008-02-20 22:07:22.000000000 +1100
@@ -126,6 +126,7 @@
     ERROR_MODE_WEBPAGE
     ERROR_MODE_DIE
     ERROR_MODE_DIE_SOAP_FAULT
+    ERROR_MODE_AJAX

     INSTALLATION_MODE_INTERACTIVE
     INSTALLATION_MODE_NON_INTERACTIVE
@@ -351,6 +352,7 @@
 use constant ERROR_MODE_WEBPAGE        => 0;
 use constant ERROR_MODE_DIE            => 1;
 use constant ERROR_MODE_DIE_SOAP_FAULT => 2;
+use constant ERROR_MODE_AJAX       => 3;

 # The various modes that checksetup.pl can run in.
 use constant INSTALLATION_MODE_INTERACTIVE => 0;

--- ../bugzilla-3.0.3-orig/Bugzilla/Error.pm    2008-02-20 19:31:56.000000000 +1100
+++ Bugzilla/Error.pm   2008-02-20 22:07:36.000000000 +1100
@@ -32,6 +32,7 @@
 use Bugzilla::WebService::Constants;
 use Bugzilla::Util;
 use Date::Format;
+use JSON;

 # We cannot use $^S to detect if we are in an eval(), because mod_perl
 # already eval'uates everything, so $^S = 1 in all cases under mod_perl!
@@ -110,6 +111,16 @@
             }
             die SOAP::Fault->faultcode($code)->faultstring($message);
         }
+        elsif (Bugzilla->error_mode == ERROR_MODE_AJAX) {
+            # JSON can't handle strings across lines.
+            $message =~ s/\n/ /gm;
+            my $err;
+            $err->{'success'} = 'false';
+            $err->{'error'} = $error;
+            $err->{'message'} = $message;
+            my $json = new JSON;
+            print $json->objToJson($err);
+        }
     }
     exit;
 }


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Assignee)

Comment 1

11 years ago
Checking in testopia/patch-3.0;
    /cvsroot/mozilla/webtools/testopia/testopia/patch-3.0,v  <--  patch-3.0
    new revision: 1.9; previous revision: 1.8
    done
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.