bayoteers / AgileTools

Bugzilla extension that provides team management and scrum tools
14 stars 4 forks source link

Bugzilla with PostgreSQL - bug in Sprint.pm #1

Closed PetrPytelka closed 11 years ago

PetrPytelka commented 11 years ago

Helllo, we are using Bugzilla with PostgreSQL. I've found small issue using this database - team cannot be created. Problem is in the function: Sprint.pm - sub create {...} This function calls (line 222): my $sprint = $class->insert_create_data($clean_params);

Function insert_create_data can be only used with the tables with SERIAL id. I've slitly modified the function: ...... my $pool = Bugzilla::Extension::AgileTools::Pool->create({name => $name}); $clean_params->{id} = $pool->id;

my $dbh = Bugzilla->dbh;
$dbh->do("INSERT INTO agile_sprint(id, start_date, end_date, team_id)
    VALUES (?,?,?,?)", undef,
    ( $pool->id, $clean_params->{start_date}),
      $clean_params->{end_date}, $clean_params->{team_id});

# Set this as teams current sprint, if it doesn't have one yet
if (! defined $team->current_sprint_id) {
    $team->set_current_sprint_id($clean_params->{id});
    $team->update();
}

my $object = $class->new($pool->id);

Bugzilla::Hook::process('object_end_of_create', { class => $class,
                                               object => $object });

$object->audit_log(AUDIT_CREATE) if $object->AUDIT_CREATES; return $object; }

This modification works fine.

Regards, Petr Pytelka