From cda232b847564a712dfe0b08e2d173768dd0417d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Jan 2023 16:43:26 +1100 Subject: [PATCH 1/3] Fixes for check data where all invitations have been archived, however a valid contact is present --- app/Console/Commands/CheckData.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 39f9808cbe..c273b87a59 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -463,8 +463,8 @@ class CheckData extends Command $contact = $contact_class::where('company_id', $entity->company_id)->where($client_vendor_key,$entity->{$client_vendor_key})->first(); //double check if an archived invite exists - if($contact && $entity->invitations()->withTrashed()->where($contact_id, $contact->id)->count() != 0) { - $i = $entity->invitations()->withTrashed()->where($contact_id, $contact->id)->first(); + if($contact && $entity_obj::withTrashed()->where($entity_key, $entity->id)->where($contact_id, $contact->id)->count() != 0) { + $i = $entity_obj::withTrashed()->where($entity_key, $entity->id)->where($contact_id, $contact->id)->first(); $i->restore(); $this->logMessage("Found a valid contact and invitation restoring for {$entity_key} - {$entity->id}"); } From f74bb36ee050f4dd71c1adfac613b366ba5bfb6c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Jan 2023 16:52:27 +1100 Subject: [PATCH 2/3] Minor fixes for create entity when models are missing --- app/Jobs/Entity/CreateEntityPdf.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 3e237ac824..6c12b1c1ec 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -1,5 +1,4 @@ Date: Sun, 29 Jan 2023 16:58:48 +1100 Subject: [PATCH 3/3] Clean up for unused includes for NinjaMailerJob --- app/Jobs/Mail/NinjaMailerJob.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 553cfeae3b..ceb8d107e0 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -19,27 +19,21 @@ use App\Jobs\Mail\NinjaMailerObject; use App\Jobs\Util\SystemLogger; use App\Libraries\Google\Google; use App\Libraries\MultiDB; -use App\Mail\TemplateEmail; use App\Models\ClientContact; use App\Models\Company; use App\Models\Invoice; use App\Models\Payment; use App\Models\SystemLog; use App\Models\User; -use App\Providers\MailServiceProvider; use App\Utils\Ninja; use App\Utils\Traits\MakesHash; -use Dacastro4\LaravelGmail\Facade\LaravelGmail; use GuzzleHttp\Exception\ClientException; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; -use Illuminate\Mail\Mailer; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\App; -use Illuminate\Support\Facades\Config; -use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Mail; use Turbo124\Beacon\Facades\LightLogs; use Illuminate\Support\Facades\Cache;