From b0282c236493ad6aa96455037c9ac876a6f0ae35 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 23 Aug 2021 07:12:58 +1000 Subject: [PATCH 1/3] Fix missing includes for triggered actions --- app/Models/Presenters/ClientPresenter.php | 2 +- app/Services/Invoice/TriggeredActions.php | 1 + routes/api.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/Presenters/ClientPresenter.php b/app/Models/Presenters/ClientPresenter.php index be0fea30a6c3..824393a7ba11 100644 --- a/app/Models/Presenters/ClientPresenter.php +++ b/app/Models/Presenters/ClientPresenter.php @@ -28,7 +28,7 @@ class ClientPresenter extends EntityPresenter } //$contact = $this->entity->primary_contact->first(); - $contact = $this->entity->contacts->first(); + $contact = $this->entity->contacts->whereNotNull('email')->first(); $contact_name = 'No Contact Set'; diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index 9dca9a50f733..ac49d0d1991b 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -12,6 +12,7 @@ namespace App\Services\Invoice; use App\Events\Invoice\InvoiceWasEmailed; +use App\Jobs\Entity\EmailEntity; use App\Jobs\Invoice\EmailEntity; use App\Models\Invoice; use App\Services\AbstractService; diff --git a/routes/api.php b/routes/api.php index ceeb78fadf6e..a0e63da14382 100644 --- a/routes/api.php +++ b/routes/api.php @@ -159,8 +159,8 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a Route::post('templates', 'TemplateController@show')->name('templates.show'); - Route::resource('tokens', 'TokenController')->middleware('password_protected'); // name = (tokens. index / create / show / update / destroy / edit - Route::post('tokens/bulk', 'TokenController@bulk')->name('tokens.bulk')->middleware('password_protected'); + Route::resource('tokens', 'TokenController'); // name = (tokens. index / create / show / update / destroy / edit + Route::post('tokens/bulk', 'TokenController@bulk')->name('tokens.bulk'); Route::get('settings/enable_two_factor', 'TwoFactorController@setupTwoFactor'); Route::post('settings/enable_two_factor', 'TwoFactorController@enableTwoFactor'); From 850c8bbf28aef5d5579ac6a19667bb42bf4b6687 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 23 Aug 2021 07:34:25 +1000 Subject: [PATCH 2/3] Fixes for namespace include --- app/Services/Invoice/TriggeredActions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index ac49d0d1991b..2516a59999ed 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -13,7 +13,6 @@ namespace App\Services\Invoice; use App\Events\Invoice\InvoiceWasEmailed; use App\Jobs\Entity\EmailEntity; -use App\Jobs\Invoice\EmailEntity; use App\Models\Invoice; use App\Services\AbstractService; use App\Utils\Ninja; From 4961c502f0775472def5d009ba62c9473a84611f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 23 Aug 2021 08:05:34 +1000 Subject: [PATCH 3/3] Fixes for redis timeout and set invoice->deleted_at to null when converting quotes to invoices --- app/Factory/CloneQuoteToInvoiceFactory.php | 2 ++ config/database.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/Factory/CloneQuoteToInvoiceFactory.php b/app/Factory/CloneQuoteToInvoiceFactory.php index 13ad94391b14..086b6db742c5 100644 --- a/app/Factory/CloneQuoteToInvoiceFactory.php +++ b/app/Factory/CloneQuoteToInvoiceFactory.php @@ -43,6 +43,8 @@ class CloneQuoteToInvoiceFactory $invoice->number = null; $invoice->date = now()->format('Y-m-d'); $invoice->balance = 0; + $invoice->deleted_at = null; + return $invoice; } } diff --git a/config/database.php b/config/database.php index 6e016d9a9130..1333795cfc0f 100644 --- a/config/database.php +++ b/config/database.php @@ -207,6 +207,7 @@ return [ ['options' => [ 'replication' => 'sentinel', 'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'), + 'sentinel_timeout' => 1.0, 'parameters' => [ 'password' => env('REDIS_PASSWORD', null), 'database' => env('REDIS_DB', 0), @@ -225,6 +226,7 @@ return [ ['options' => [ 'replication' => 'sentinel', 'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'), + 'sentinel_timeout' => 1.0, 'parameters' => [ 'password' => env('REDIS_PASSWORD', null), 'database' => env('REDIS_CACHE_DB', 1),