From ea6eacb400d23fa118677290fb5b262d88f91e12 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Fri, 21 Oct 2022 21:49:29 +0100 Subject: [PATCH] Fixed chapter fetching during joint permission building Somehow I accidentally deleted previous line 143 in this commit: 3839bf6bf11ac6b4d19c2ae8f62a314a2c164251 which would then break permission generation for content related to, or containing, chapters in the recycle bin. Found via user report (subz) & debugging in discord. --- app/Auth/Permissions/JointPermissionBuilder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Auth/Permissions/JointPermissionBuilder.php b/app/Auth/Permissions/JointPermissionBuilder.php index 79903c027..129b4a04d 100644 --- a/app/Auth/Permissions/JointPermissionBuilder.php +++ b/app/Auth/Permissions/JointPermissionBuilder.php @@ -140,6 +140,7 @@ class JointPermissionBuilder return Book::query()->withTrashed() ->select(['id', 'owned_by'])->with([ 'chapters' => function ($query) { + $query->withTrashed()->select(['id', 'owned_by', 'book_id']); }, 'pages' => function ($query) { $query->withTrashed()->select(['id', 'owned_by', 'book_id', 'chapter_id']);