From 648e77c9a01a8ac478d437f332aba1c72fdb07ec Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Thu, 21 Feb 2008 23:45:13 +0000 Subject: [PATCH] Fixed more API issues git-svn-id: svn://10.0.0.236/trunk@246241 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm | 2 +- mozilla/webtools/testopia/Bugzilla/Testopia/Environment.pm | 2 +- mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm | 5 ++++- .../webtools/testopia/Bugzilla/WebService/Testopia/Build.pm | 4 ++-- .../testopia/Bugzilla/WebService/Testopia/TestCase.pm | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm index 2acae8ae41f..09e07eb5e6f 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm @@ -29,7 +29,7 @@ use Bugzilla::Testopia::TestCase; use JSON; use base qw(Exporter Bugzilla::Object); -@Bugzilla::Bug::EXPORT = qw(check_build check_build_by_name); +@Bugzilla::Testopia::Build::EXPORT = qw(check_build check_build_by_name); ############################### #### Initialization #### diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment.pm index 9cc2c8ada90..cb79b27a0c3 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment.pm @@ -79,7 +79,7 @@ use constant DB_COLUMNS => qw( ); use constant REQUIRED_CREATE_FIELDS => qw(name product_id); -use constant UPDATE_COLUMNS => qw(name product_id isactive); +use constant UPDATE_COLUMNS => qw(name isactive); use constant VALIDATORS => { product_id => \&_check_product, diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm index b5272e1f62e..70b8b842859 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm @@ -219,7 +219,8 @@ sub _check_automated{ sub _check_sortkey{ my ($invocant, $sortkey) = @_; $sortkey = trim($sortkey); - ThrowUserError('invalid_value', {argument => 'sortkey', value => $sortkey}) unless ($sortkey =~ /^\d+$/); + return unless $sortkey; + ThrowUserError('bad_arg', {argument => 'sortkey', function => 'set_sortkey'}) unless ($sortkey =~ /^\d+$/); return $sortkey; } @@ -493,6 +494,8 @@ sub update { my $changed = $self->SUPER::update(); + delete $changed->{'sortkey'}; + foreach my $field (keys %$changed){ Bugzilla::Testopia::Util::log_activity('case', $self->id, $field, $timestamp, $changed->{$field}->[0], $changed->{$field}->[1]); diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm index 6416f479af9..630e185e596 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm @@ -76,7 +76,7 @@ sub update my $name = $$new_values{name}; - if (defined($name) && check_build($name, $build->product_id)) + if (defined($name) && check_build($name, new Bugzilla::Product($build->product_id))) { die "Build name, " . $name . ", already exists"; } @@ -122,7 +122,7 @@ sub lookup_name_by_id return $result; } -# DEPRECATED use Build::check_build($name, $product_id) instead +# DEPRECATED use Build::check_build($name, $product_obj) instead sub lookup_id_by_name { my $self = shift; diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm index 44bc0aa2ec9..d464475e52c 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm @@ -111,7 +111,7 @@ sub create my $test_case = Bugzilla::Testopia::TestCase->create($new_values); - $test_case->link_plan($plan_id, $test_case->id); + $test_case->link_plan($plan->id, $test_case->id); $self->logout;