]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Tools/TrashCan.php
Default templates: Added page picker and working forms
[bookstack] / app / Entities / Tools / TrashCan.php
index 08276230c4059eabc5427350ede5df693ba0a486..b0c452456a06d541a97c7e301ed1d7d74b91ef13 100644 (file)
@@ -202,6 +202,10 @@ class TrashCan
             $attachmentService->deleteFile($attachment);
         }
 
+        // Remove book template usages
+        Book::query()->where('default_template', '=', $page->id)
+            ->update(['default_template' => null]);
+
         $page->forceDelete();
 
         return 1;