summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-27 15:42:50 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-12-06 11:05:08 +0100
commit60d8b93c0017253f11bbea0108e0a25e371e4a9b (patch)
tree85acffca67c1b4cd98245f605a742ed5a59d8543
parentca250629683589f56fe583e4377c9ded3d25b197 (diff)
downloadbugzilla-60d8b93c0017253f11bbea0108e0a25e371e4a9b.tar.gz
bugzilla-60d8b93c0017253f11bbea0108e0a25e371e4a9b.tar.xz
WIP: rename bug variable
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--Bugzilla/Migrate/Flyspray.pm32
1 files changed, 16 insertions, 16 deletions
diff --git a/Bugzilla/Migrate/Flyspray.pm b/Bugzilla/Migrate/Flyspray.pm
index 84dc247ca..38a450b36 100644
--- a/Bugzilla/Migrate/Flyspray.pm
+++ b/Bugzilla/Migrate/Flyspray.pm
@@ -305,14 +305,14 @@ sub _read_bugs {
LEFT OUTER JOIN $fsdb.${fsprfx}list_status ls ON ls.status_id = t.item_status
LEFT OUTER JOIN $fsdb.${fsprfx}list_resolution lr ON lr.resolution_id = t.resolution_reason
LEFT OUTER JOIN $fsdb.${fsprfx}list_version lv ON lv.version_id = t.product_version
- WHERE t.task_id IN (23884, 22102)
+ WHERE t.task_id IN (21668, 22102, 23845, 23884)
GROUP BY t.task_id, a.task_id
");
$sth->execute();
my @result;
while (my $row = $sth->fetchrow_hashref()) {
- my $item = {
+ my $bug = {
short_desc => $row->{item_summary},
product => $self->{map_project_id_to_name}->{$row->{project_id}},
component => $self->{map_component_id_to_name}->{$row->{product_category}}
@@ -333,18 +333,18 @@ sub _read_bugs {
version => $row->{version_name} // "unspecified",
comment => $row->{detailed_desc},
};
- $item->{version} = "unspecified" if $item->{version} eq "None";
- $item->{resolution} = "UNSPECIFIED" if $item->{resolution} eq "None";
- $item->{bug_status} = "RESOLVED" if $item->{resolution} ne "";
- $item->{component} = $self->{map_component_id_to_name}->{-1}
+ $bug->{version} = "unspecified" if $bug->{version} eq "None";
+ $bug->{resolution} = "UNSPECIFIED" if $bug->{resolution} eq "None";
+ $bug->{bug_status} = "RESOLVED" if $bug->{resolution} ne "";
+ $bug->{component} = $self->{map_component_id_to_name}->{-1}
if not defined $self->{project_id_components}->{$row->{project_id}}
- ->{$item->{component}};
+ ->{$bug->{component}};
# handle initial comment/description
- if (length($item->{comment}) > 65535) {
- $item->{comment}
+ if (length($bug->{comment}) > 65535) {
+ $bug->{comment}
= "--- The description has been moved to an attachment because it is longer than 65535 characters ---";
- unshift @{$item->{attachments}},
+ unshift @{$bug->{attachments}},
{
data => $row->{detailed_desc},
description => "Initial bug description",
@@ -367,7 +367,7 @@ sub _read_bugs {
bug_when => $self->parse_date($comment->{date_added}),
thetext => $comment->{comment_text},
};
- push @{$item->{comments}}, $comment_item;
+ push @{$bug->{comments}}, $comment_item;
$comments->{$comment->{comment_id}} = $comment_item;
}
@@ -394,7 +394,7 @@ sub _read_bugs {
# type 2 -> closed bug
my $closure_comment = $history->{old_value};
if ($closure_comment ne "") {
- push @{$item->{comments}},
+ push @{$bug->{comments}},
{
who => $self->_get_username($history->{user_id}),
bug_when => $self->parse_date($history->{event_date}),
@@ -402,7 +402,7 @@ sub _read_bugs {
};
}
- push @{$item->{history}},
+ push @{$bug->{history}},
{
who => $self->_get_username($history->{user_id}),
bug_when => $self->parse_date($history->{event_date}),
@@ -415,7 +415,7 @@ sub _read_bugs {
# type 3 -> field changed
if ($history->{field_changed} eq "item_status") {
- push @{$item->{history}},
+ push @{$bug->{history}},
{
who => $self->_get_username($history->{user_id}),
bug_when => $self->parse_date($history->{event_date}),
@@ -441,7 +441,7 @@ sub _read_bugs {
$attachments_sth->execute($row->{task_id});
my $attpath = $self->config("attachment_path");
while (my $attachment = $attachments_sth->fetchrow_hashref()) {
- push @{$item->{attachments}},
+ push @{$bug->{attachments}},
{
submitter => $self->_get_username($attachment->{added_by}),
creation_ts => $attachment->{date_added},
@@ -457,7 +457,7 @@ sub _read_bugs {
# change _insert_attachments/_insert_comments?
}
- push @result, $item;
+ push @result, $bug;
}
#$self->debug(\@result, 3);