From 9aee129737252e97a7f70508c6a4d2e1c3b8d134 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 28 Nov 2020 17:22:43 +1100 Subject: [PATCH] Fixes for import --- app/Jobs/Util/Import.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index c9f2eadcdd..7b210f32cb 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -1107,12 +1107,20 @@ class Import implements ShouldQueue $old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id; - $this->ids['expense_categories'] = [ - "expense_categories_{$old_user_key}" => [ - 'old' => $resource['id'], + + $key = "expense_categories_{$resource['id']}"; + + $this->ids['expense_categories'][$key] = [ + 'old' => $resource['id'], 'new' => $expense_category->id, - ], ]; + + // $this->ids['expense_categories'] = [ + // "expense_categories_{$old_user_key}" => [ + // 'old' => $resource['id'], + // 'new' => $expense_category->id, + // ], + // ]; } ExpenseCategory::reguard();