]>
BookStack Code Mirror - bookstack/blobdiff - app/Entities/Tools/TrashCan.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Default templates: Added page picker and working forms
[bookstack]
/
app
/
Entities
/
Tools
/
TrashCan.php
diff --git
a/app/Entities/Tools/TrashCan.php
b/app/Entities/Tools/TrashCan.php
index 08276230c4059eabc5427350ede5df693ba0a486..b0c452456a06d541a97c7e301ed1d7d74b91ef13 100644
(file)
--- a/
app/Entities/Tools/TrashCan.php
+++ b/
app/Entities/Tools/TrashCan.php
@@
-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;