From ee9e342b58a57ae909f0635dde26b96c37f8583c Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 17 Aug 2023 14:59:28 +0100 Subject: [PATCH] Notifications: Fixed issues causing failing tests - Ensured watch options passed in all meta template usage to fix failing scenarios where watch options did not exist. - Fixed testing issue caused by guest user permission caching. --- app/Users/Models/User.php | 7 +++++-- resources/views/books/show.blade.php | 2 +- resources/views/chapters/show.blade.php | 2 +- resources/views/pages/revision.blade.php | 2 +- resources/views/pages/show.blade.php | 2 +- resources/views/shelves/show.blade.php | 2 +- tests/Activity/WatchTest.php | 1 + tests/Helpers/UserRoleProvider.php | 2 +- tests/TestCase.php | 2 ++ 9 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/Users/Models/User.php b/app/Users/Models/User.php index 08cab69fb..be3e9b9b3 100644 --- a/app/Users/Models/User.php +++ b/app/Users/Models/User.php @@ -88,8 +88,6 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon /** * This holds the default user when loaded. - * - * @var null|User */ protected static ?User $defaultUser = null; @@ -107,6 +105,11 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon return static::$defaultUser; } + public static function clearDefault(): void + { + static::$defaultUser = null; + } + /** * Check if the user is the default public user. */ diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index 0fb98e304..75b01a379 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -70,7 +70,7 @@
{{ trans('common.details') }}