From 02ebabc5db9c30674b76a2edaf8f8b5f1648bccb Mon Sep 17 00:00:00 2001 From: blakej115 Date: Thu, 20 Oct 2022 21:23:18 -0400 Subject: [PATCH] Fixed getting total count of records preventing install because the records table doesn't exist --- classes/UnreadRecords.php | 7 +++++-- updates/version.yaml | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/classes/UnreadRecords.php b/classes/UnreadRecords.php index 0dd0b56..ee4f00c 100644 --- a/classes/UnreadRecords.php +++ b/classes/UnreadRecords.php @@ -7,8 +7,11 @@ class UnreadRecords { public static function getTotal() { - $unread = Record::where('unread', 1)->count(); - return ($unread > 0) ? $unread : null; + if (Schema::hasTable('blakejones_magicforms_records')) { + $unread = Record::where('unread', 1)->count(); + } + + return (isset($unread) && $unread > 0) ? $unread : null; } } diff --git a/updates/version.yaml b/updates/version.yaml index c39c876..f97ef72 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -132,4 +132,6 @@ - changed namespace - Added support for October CMS v3 1.6.1: - - Fixes support for Translate v2 [thanks to daftspunk] \ No newline at end of file + - Fixes support for Translate v2 [thanks to daftspunk] +1.6.2: + - Fixed getting total count of records preventing install because the records table doesn't exist \ No newline at end of file