diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm index 3ae5e4482be..7424ef2fc80 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm @@ -420,7 +420,9 @@ sub obliterate { my $self = shift; my $dbh = Bugzilla->dbh; - $p->obliterate foreach my $p (@{$self->get_properties}); + foreach my $p (@{$self->get_properties}){ + $p->obliterate; + } $dbh->do("DELETE FROM test_environment_map WHERE element_id = ?", undef, $self->id); diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm index fa7d9fe2772..4ebc7053e50 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm @@ -489,9 +489,14 @@ sub init { $f = 'case_status.name'; }, "^priority," => sub { + if ($obj eq 'case_run'){ + push(@supptables, + "INNER JOIN test_cases + ON test_cases.case_id = test_case_runs.case_id"); + } push(@supptables, "INNER JOIN priority ". - "ON test_". $obj ."s.priority_id = priority.id"); + "ON test_cases.priority_id = priority.id"); $f = 'priority.value'; }, "^environment," => sub { diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm index aa42e141404..c205b5a418b 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm @@ -1297,6 +1297,8 @@ sub get_user_rights { my $plan_ids = $dbh->selectcol_arrayref( "SELECT plan_id FROM test_case_plans WHERE case_id = ?", undef, $self->id); + + return 0 unless $plan_ids; $plan_ids = join(',',@$plan_ids); my ($perms) = $dbh->selectrow_array( @@ -1305,7 +1307,7 @@ sub get_user_rights { INNER JOIN test_cases ON test_case_plans.case_id = test_cases.case_id WHERE userid = ? AND test_plan_permissions.plan_id IN ($plan_ids)", undef, $userid); - print STDERR $perms; + return $perms; } ############################### diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm index 6904e9c82f4..313dbdc1a83 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm @@ -695,11 +695,11 @@ Removes this caserun, its history, and all things that reference it. sub obliterate { my $self = shift; my $dbh = Bugzilla->dbh; - - $dbh->do("DELETE FROM test_case_bugs WHERE case_run_id IN (" . - join(",", @{$self->get_case_run_list}) . ")", undef, $self->id) - if $self->get_case_run_list; - + my $sth = $dbh->prepare_cached("DELETE FROM test_case_bugs WHERE case_run_id = ?"); + foreach my $id (@{$self->get_case_run_list}){ + $sth->execute($id); + } + $dbh->do("DELETE FROM test_case_runs WHERE case_id = ? AND run_id = ?", undef, ($self->case_id, $self->run_id)); return 1; diff --git a/mozilla/webtools/testopia/template/en/default/hook/global/useful-links.html.tmpl/end/tr.html.tmpl b/mozilla/webtools/testopia/template/en/default/hook/global/useful-links.html.tmpl/end/tr.html.tmpl index c28d50b8cc1..6de0281ca4d 100644 --- a/mozilla/webtools/testopia/template/en/default/hook/global/useful-links.html.tmpl/end/tr.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/hook/global/useful-links.html.tmpl/end/tr.html.tmpl @@ -38,11 +38,15 @@