Fixed more API issues
git-svn-id: svn://10.0.0.236/trunk@246241 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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 ####
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user