]> BookStack Code Mirror - bookstack/commitdiff
Fixed chapter fetching during joint permission building
authorDan Brown <redacted>
Fri, 21 Oct 2022 20:49:29 +0000 (21:49 +0100)
committerDan Brown <redacted>
Fri, 21 Oct 2022 20:49:29 +0000 (21:49 +0100)
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

index 79903c0275afead14926463eda73cf68a9a2c70e..129b4a04d149df87e1f0e74cc34ce09be4a26f0d 100644 (file)
@@ -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']);