Skip to content

Commit

Permalink
Fixed getting total count of records preventing install because the r…
Browse files Browse the repository at this point in the history
…ecords table doesn't exist
  • Loading branch information
blakej115 committed Oct 21, 2022
1 parent 02333f9 commit 02ebabc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions classes/UnreadRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Expand Down
4 changes: 3 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@
- changed namespace
- Added support for October CMS v3
1.6.1:
- Fixes support for Translate v2 [thanks to daftspunk]
- 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

0 comments on commit 02ebabc

Please sign in to comment.