summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Migrate.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Migrate.pm')
-rw-r--r--Bugzilla/Migrate.pm28
1 files changed, 20 insertions, 8 deletions
diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm
index 925a01355..90623ff67 100644
--- a/Bugzilla/Migrate.pm
+++ b/Bugzilla/Migrate.pm
@@ -155,22 +155,22 @@ sub do_migration {
$dbh->bz_start_transaction();
# Read Other Database
- my $users = $self->users;
- my $products = $self->products;
- my $bugs = $self->bugs;
+ $self->users;
+ $self->products;
+ $self->bugs;
$self->after_read();
- $self->translate_all_bugs($bugs);
+ $self->translate_all_bugs($self->bugs);
Bugzilla->set_user(Bugzilla::User->super_user);
# Insert into Bugzilla
$self->before_insert();
- $self->insert_users($users);
- $self->insert_products($products);
+ $self->insert_users($self->users());
+ $self->insert_products($self->products());
$self->create_custom_fields();
- $self->create_legal_values($bugs);
- $self->insert_bugs($bugs);
+ $self->create_legal_values($self->bugs());
+ $self->insert_bugs($self->bugs());
$self->after_insert();
if ($self->dry_run) {
$dbh->bz_rollback_transaction();
@@ -279,7 +279,12 @@ sub bugs {
###########
sub check_requirements {
+ return;
my $self = shift;
+ # FIXME: This is broken. the function that is called doesn't exist any more
+ # and I don't see an apparent replacement to use here. doesn't matter much
+ # for debugging so just disable it for now
+ return;
my $missing = Bugzilla::Install::Requirements::_check_missing(
$self->REQUIRED_MODULES, 1);
my %results = (
@@ -767,6 +772,9 @@ sub insert_bugs {
$dbh->do('UPDATE bugs SET creation_ts = ?, delta_ts = ?
WHERE bug_id = ?', undef, $bug->{creation_ts},
$bug->{creation_ts}, $created->id);
+ $dbh->do('UPDATE longdescs SET bug_when = ?
+ WHERE bug_id = ?', undef, $bug->{creation_ts},
+ $created->id);
}
if (defined $bug->{delta_ts}) {
$dbh->do('UPDATE bugs SET delta_ts = ? WHERE bug_id = ?',
@@ -841,6 +849,10 @@ sub _insert_attachments {
$self->debug(' Inserting attachments:', 2);
foreach my $attachment (@$attachments) {
$self->debug($attachment, 3);
+ my $data_path = delete $attachment->{data_path};
+ if (defined $data_path) {
+ $attachment->{data} = IO::File->new($data_path, 'r');
+ }
# Make sure that our pointer is at the beginning of the file,
# because usually it will be at the end, having just been fully
# written to.