Closed Bug 376670 Opened 17 years ago Closed 17 years ago

New Test Run Environment Combo Box does not list Environments on initial create page

Categories

(Testopia :: Test Runs, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 383246

People

(Reporter: erich.zimmerman, Assigned: gregaryh)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11
Build Identifier: Testopia 1.2, Bugzilla 2.22.2

When I attempted to create a test run using existing environments, the Environment combo box is empty and stays empty. If I attempt to enter an Environment ID manually, it is erased by the browser script logic. This prevents me from creating a test plan with an existing Environment.


Reproducible: Always

Steps to Reproduce:
1. Click the 'New Run' link
2. If prompted (i.e. not already on a Test Plan), select an existing Test Plan
3. At the bottom of the New Run page (attributes), the Combo Box for listing current environments will not populate.


Actual Results:  
Blank combo box on Environment. Test Run will not create unless I enter text in the New box.

Expected Results:  
The current list of Environments should appear in the combo box.

After looking in the code, the only thing that I could come up with is that it might have something to do with the fact that the New Test Run page uses a run_id of 0 until it is created. 

Does the getenv search depend on a valid run_id, or am I just way off base? I have attempted to comment out specific lines of code that make assumptions about the run_id, but that has not helped.
I can reproduce the bug on Linux.
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → 1.3
Version: unspecified → 1.2
Reproduced on brand new install:
- Ubuntu, 7.04 server (mysql5, perl5.8, apache2) - uptodate
- Bugzilla 2.22.2
- Testopia 1.2

Workaround:  Create the first test run on new environment, and later clone test runs.  Quite annoying though...
The box will only display the environments that are associated with the product the run's plan is in (see bug 383245).

You can, also create a new environment at the time you create the run, by entering the name in the new box. You can then go edit it and add the elements you want. 
The field on the page resulting tr_show_run.cgi DOES properly show the environments for the associatied product and plan.
But the field on the page resulting tr_new_run.cgi DOES NOT enlist any environments.

If tr_quicksearch.cgi is called by 
tr_quicksearch.cgi?action=getenv&run_id=1&search=         results OK
tr_quicksearch.cgi?action=getenv&run_id=0&search=         result empty set!

Some debugging resulted:

The embedded %{searchstring} variable handling or the AJAX from line 179 is causing the mixup in the tr_quicksearch.cgi url: resulting alwas an empty set in SELECT if run_id=0.

I dunno what how to fix the search string, but omitting it, resulted working environment gadget...

If you fix the %{searchstring} issue, the environment list will also be populated in the new_run form.

Proof: the Tester Gadget also fails to find logins by searchstring.
Well, after some more debugging...

The problem is caused by the 

        eval {
            detaint_natural($run_id);
            trick_taint($search);
            validate_test_id($run_id, 'run');
        };
        exit if $@;

term since a new run with run_id=0 always fails and exits with no result set in the drop down box.  

Quick and Dirty solution: 
Line 191 in tr_quicksearch.cgi
Commenting the validate_test_id() line solves the problem.  I will test on, if it causes any error in future.

Looking forward for the professional patch.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.