From 342b3831155b5c27223edb505803f887bd91ba02 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 29 Apr 2021 12:12:44 +1000 Subject: [PATCH] Minor fixes for imports --- app/Http/Middleware/QueryLogging.php | 6 +++--- app/Jobs/Util/Import.php | 13 +------------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index 5597eaaeb471..19c77fb4889f 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -36,9 +36,9 @@ class QueryLogging { // Enable query logging for development - // if (!Ninja::isHosted() || !config('beacon.enabled')) { - // return $next($request); - // } + if (!Ninja::isHosted() || !config('beacon.enabled')) { + return $next($request); + } $timeStart = microtime(true); DB::enableQueryLog(); diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index a50b64db9383..907dad323646 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -192,15 +192,6 @@ class Import implements ShouldQueue $array = json_decode(file_get_contents($this->file_path), 1); $data = $array['data']; - - // disable some functionality here: - // 1. disable update_products - - $update_product_state = $this->company->update_products; - - $this->company->update_products = false; - $this->company->save(); - foreach ($this->available_imports as $import) { if (! array_key_exists($import, $data)) { //throw new ResourceNotAvailableForMigration("Resource {$key} is not available for migration."); @@ -220,9 +211,7 @@ class Import implements ShouldQueue // $this->fixClientBalances(); $check_data = CheckCompanyData::dispatchNow($this->company, md5(time())); - //reset functionality here - $this->company->update_products = $update_product_state; - $this->company->save(); + try{ Mail::to($this->user->email, $this->user->name())