diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-03-09 14:53:18 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-12-06 11:05:08 +0100 |
commit | 78dd0cc500f6ce53bda9a0f1de96b4210363ceaf (patch) | |
tree | ba674061e465a1b1c477d1d7760391cb1ba1b4d0 | |
parent | f668427531b9e81a5e94950722aa8514bfd641a8 (diff) | |
download | bugzilla-78dd0cc500f6ce53bda9a0f1de96b4210363ceaf.tar.gz bugzilla-78dd0cc500f6ce53bda9a0f1de96b4210363ceaf.tar.xz |
Misc fixes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | Bugzilla/Migrate.pm | 11 | ||||
-rwxr-xr-x | migrate.pl | 11 |
2 files changed, 19 insertions, 3 deletions
diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm index 74bce149f..e52e1ea87 100644 --- a/Bugzilla/Migrate.pm +++ b/Bugzilla/Migrate.pm @@ -280,6 +280,7 @@ sub bugs { ########### sub check_requirements { + return; my $self = shift; my $missing = Bugzilla::Install::Requirements::_check_missing($self->REQUIRED_MODULES, 1); @@ -687,7 +688,7 @@ sub insert_bugs { my $dbh = Bugzilla->dbh; print get_text('migrate_creating_bugs'), "\n"; - my $init_statuses = Bugzilla::Status->can_change_to(); + my $init_statuses = Bugzilla::Status->can_change_to(); my %allowed_statuses = map { lc($_->name) => 1 } @$init_statuses; # Bypass the question of whether or not we can file UNCONFIRMED @@ -788,6 +789,10 @@ sub insert_bugs { 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 = ?', @@ -863,6 +868,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 diff --git a/migrate.pl b/migrate.pl index 907e0cab5..0c67df42f 100755 --- a/migrate.pl +++ b/migrate.pl @@ -11,8 +11,15 @@ use strict; use warnings; use File::Basename; -BEGIN { chdir dirname($0); } -use lib qw(. lib local/lib/perl5); +use File::Spec; +BEGIN { + require lib; + my $dir = File::Spec->rel2abs(dirname(__FILE__)); + my $base = File::Spec->catdir($dir); + lib->import($base, File::Spec->catdir($base, "lib"), File::Spec->catdir($base, qw(local lib perl5))); + chdir $base; +} + use Bugzilla; use Bugzilla::Migrate; |