Skip to content

Commit

Permalink
Fixed attachments not importing after my changes.
Browse files Browse the repository at this point in the history
Pass in history id when creating new item in repository.
  • Loading branch information
nmoinvaz committed Apr 23, 2018
1 parent 9ff08b1 commit 3985fd6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/API/Provider/Zendesk/DataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ protected function mapChildEvent(\stdClass $event, array &$data)
$data['ticketId'],
$data['requesterId'] ?: $data['updaterId'],
$this->getHistoryStatus($event->status),
$data['date']
$data['date'],
$data['id']
);

if ('open' === $event->status) {
Expand All @@ -187,9 +188,7 @@ protected function mapChildEvent(\stdClass $event, array &$data)
protected function mapReplyOrTicket(array $data)
{
if ($data['isOriginalTicket'] && isset($data['attachments'])) {
foreach ($data['attachments'] as $attachment) {
$this->mapAttachments($attachment, $data['ticketId']);
}
$this->mapAttachments($data['attachments'], $data['ticketId']);
return;
}

Expand All @@ -199,9 +198,7 @@ protected function mapReplyOrTicket(array $data)

$this->replyRepository->create($data['ticketId'], $data['replyId'], $data['reply']);
if (isset($data['attachments'])) {
foreach ($data['attachments'] as $attachment) {
$this->mapAttachments($attachment, $data['ticketId'], $data['replyId']);
}
$this->mapAttachments($data['attachments'], $data['ticketId'], $data['replyId']);
}
}

Expand Down

0 comments on commit 3985fd6

Please sign in to comment.