From 6eab259568b827212ea9a421318b61f496257534 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Aug 2022 10:38:40 +1000 Subject: [PATCH 1/2] add memory limit to PHP check --- app/Http/Controllers/SelfUpdateController.php | 17 ----------------- app/Utils/SystemHealth.php | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 8a390416775b..32324873a9f6 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -136,15 +136,6 @@ class SelfUpdateController extends BaseController //clean up old snappdf installations $this->cleanOldSnapChromeBinaries(); - // try{ - // $s = new Snappdf; - // $s->getChromiumPath(); - // chmod($this->generatePlatformExecutable($s->getChromiumPath()), 0755); - // } - // catch(\Exception $e){ - // nlog("I could not set the file permissions for chrome"); - // } - $zipFile = new \PhpZip\ZipFile(); $zipFile->openFile($file); @@ -153,14 +144,6 @@ class SelfUpdateController extends BaseController $zipFile->close(); - // $zip = new \ZipArchive; - - // $res = $zip->open($file); - // if ($res === TRUE) { - // $zip->extractTo(base_path()); - // $zip->close(); - // } - nlog('Finished extracting files'); unlink($file); diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 5243b7872f28..90c3bf8dcd40 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -67,9 +67,9 @@ class SystemHealth 'current_php_version' => phpversion(), 'current_php_cli_version' => (string) self::checkPhpCli(), 'is_okay' => version_compare(phpversion(), self::$php_version, '>='), + 'memory_limit' => ini_get('memory_limit'), ], 'env_writable' => self::checkEnvWritable(), - //'mail' => self::testMailServer(), 'simple_db_check' => self::simpleDbCheck(), 'cache_enabled' => self::checkConfigCache(), 'phantom_enabled' => (bool) config('ninja.phantomjs_pdf_generation'), From 5371bed25b87f1e9d64a78231c85257cdf460844 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Aug 2022 11:12:50 +1000 Subject: [PATCH 2/2] Fixes for missing invites for recurring invitations --- .../Recurring/CreateRecurringInvitations.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Services/Recurring/CreateRecurringInvitations.php b/app/Services/Recurring/CreateRecurringInvitations.php index fa06976eba1d..0aec0a0eafaa 100644 --- a/app/Services/Recurring/CreateRecurringInvitations.php +++ b/app/Services/Recurring/CreateRecurringInvitations.php @@ -63,6 +63,19 @@ class CreateRecurringInvitations extends AbstractService info($e->getMessage()); } + if ($this->entity->invitations()->count() == 0) { + + $invitation = $this->invitation_class::where('company_id', $this->entity->company_id) + ->where($this->entity_id_name, $this->entity->id) + ->withTrashed() + ->first(); + + if ($invitation) + $invitation->restore(); + + } + + return $this->entity; } }