diff --git a/mozilla/webtools/testopia/testopia/js/case.js b/mozilla/webtools/testopia/testopia/js/case.js index 36c16ebc699..7cee24ca450 100644 --- a/mozilla/webtools/testopia/testopia/js/case.js +++ b/mozilla/webtools/testopia/testopia/js/case.js @@ -1159,6 +1159,7 @@ CaseClonePanel = function(product_id, cases){ id: 'case_clone_frm', border: false, frame: true, + autoScroll: true, bodyStyle: 'padding: 10px', labelWidth: 250, height: 280, @@ -1231,11 +1232,11 @@ CaseClonePanel = function(product_id, cases){ Ext.getCmp('case_copy_plan_ids').setValue(getSelectedObjects(Ext.getCmp('plan_clone_grid'), 'plan_id')); var form = Ext.getCmp('case_clone_frm').getForm(); var params = form.getValues(); - params.action = 'clone'; - params.ids = cases; + form.baseParams = {}; + form.baseParams.action = 'clone'; + form.baseParams.ids = cases; form.submit({ url: 'tr_list_cases.cgi', - params: params, success: function(form, data){ if (params.copy_cases){ if (data.result.tclist.length ==1){ @@ -1269,7 +1270,11 @@ CaseClonePanel = function(product_id, cases){ }); } Ext.getCmp('case-clone-win').close(); - Ext.getCmp('case_plan_grid').store.reload(); + try{ + Ext.getCmp('case_plan_grid').store.reload(); + } + catch (err){}; + }, failure: testopiaError }); diff --git a/mozilla/webtools/testopia/tr_list_cases.cgi b/mozilla/webtools/testopia/tr_list_cases.cgi index e87613a9fae..5ecea1fd52c 100755 --- a/mozilla/webtools/testopia/tr_list_cases.cgi +++ b/mozilla/webtools/testopia/tr_list_cases.cgi @@ -30,6 +30,7 @@ use Bugzilla::Error; use Bugzilla::Constants; use Bugzilla::Testopia::Search; use Bugzilla::Testopia::Util; +use Bugzilla::Testopia::Category; use Bugzilla::Testopia::TestCase; use Bugzilla::Testopia::TestCaseRun; use Bugzilla::Testopia::TestPlan; @@ -147,7 +148,7 @@ elsif ($action eq 'clone'){ my $product = Bugzilla::Testopia::Product->new($cgi->param('product_id')); ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $cgi->param('product_id')}) unless $product; - if ($cgi->param('copy_categories')){ + if ($cgi->param('copy_category')){ ThrowUserError('testopia-read-only', {'object' => $product}) unless $product->canedit; } @@ -163,7 +164,7 @@ elsif ($action eq 'clone'){ my $case_author = $cgi->param('keep_author') ? $case->author->id : Bugzilla->user->id; my $case_tester = $cgi->param('keep_tester') ? $case->default_tester->id : Bugzilla->user->id; my $category; - if ($cgi->param('copy_categories')){ + if ($cgi->param('copy_category')){ my $category_id = check_case_category($case->category->name, $product); if (! $category_id){ $category = Bugzilla::Testopia::Category->create({ @@ -175,7 +176,6 @@ elsif ($action eq 'clone'){ else { $category = Bugzilla::Testopia::Category->new($category_id); } - } else { if ($product->id == $case->category->product_id){ @@ -196,7 +196,7 @@ elsif ($action eq 'clone'){ } } } - + my $caseid = $case->copy($case_author, $case_tester, $cgi->param('copy_doc') eq 'on' ? 1 : 0, $category->id); my $newcase = Bugzilla::Testopia::TestCase->new($caseid); push @newcases, $newcase->id;