[PR #3118] [MERGED] Additional copy/clone abilities #6137

Closed
opened 2026-02-05 10:25:19 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/3118
Author: @ssddanbrown
Created: 12/19/2021
Status: Merged
Merged: 12/20/2021
Merged by: @ssddanbrown

Base: masterHead: copy_stuff


📝 Commits (5)

  • da01913 Added ability to copy a role
  • 3f9527f Extracted page copy to new cloner class
  • 20e093a Added ability to copy/clone chapters
  • 0288320 Added ability to clone books
  • ff70509 Added copy considerations

📊 Changes

23 files changed (+894 additions, -327 deletions)

View changed files

📝 app/Entities/Models/Chapter.php (+1 -1)
📝 app/Entities/Repos/ChapterRepo.php (+23 -10)
📝 app/Entities/Repos/PageRepo.php (+2 -39)
app/Entities/Tools/Cloner.php (+150 -0)
📝 app/Facades/Activity.php (+3 -0)
📝 app/Http/Controllers/BookController.php (+38 -1)
📝 app/Http/Controllers/ChapterController.php (+47 -0)
📝 app/Http/Controllers/PageController.php (+9 -11)
📝 app/Http/Controllers/RoleController.php (+15 -4)
📝 resources/lang/en/entities.php (+12 -0)
resources/views/books/copy.blade.php (+40 -0)
📝 resources/views/books/show.blade.php (+6 -0)
resources/views/chapters/copy.blade.php (+50 -0)
📝 resources/views/chapters/show.blade.php (+6 -0)
resources/views/entities/copy-considerations.blade.php (+15 -0)
📝 resources/views/pages/copy.blade.php (+2 -0)
📝 resources/views/settings/roles/create.blade.php (+15 -3)
📝 resources/views/settings/roles/edit.blade.php (+47 -4)
📝 resources/views/settings/roles/parts/form.blade.php (+211 -254)
📝 routes/web.php (+4 -0)

...and 3 more files

📄 Description

As per definition at https://github.com/BookStackApp/BookStack/issues/1123#issuecomment-997232636.

Todo

  • Role copying
  • Chapter copying
  • Book copying
  • Testing
  • Update views to highlight considerations below?

Considerations

  • Permissions will not be copied.
  • Page Attachments will not be copied.
  • Page images will not be updated nor will their relation to pages be updated.
  • Copied content owner will be the copier.
  • Due to the above, copied content could be visible to a different set of people.

Related to #1123


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/3118 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 12/19/2021 **Status:** ✅ Merged **Merged:** 12/20/2021 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `copy_stuff` --- ### 📝 Commits (5) - [`da01913`](https://github.com/BookStackApp/BookStack/commit/da019136166fdf69fec526d8a056411bf8b3478d) Added ability to copy a role - [`3f9527f`](https://github.com/BookStackApp/BookStack/commit/3f9527f166740b8580adbf513600fd46104f47d0) Extracted page copy to new cloner class - [`20e093a`](https://github.com/BookStackApp/BookStack/commit/20e093a7a1f5bc56936c9da4456e7646c52f71ef) Added ability to copy/clone chapters - [`0288320`](https://github.com/BookStackApp/BookStack/commit/0288320700668bae9d87bcc7c3e7d66aaa05f6aa) Added ability to clone books - [`ff70509`](https://github.com/BookStackApp/BookStack/commit/ff70509fca96c9a52b82b1044d22daef4d270170) Added copy considerations ### 📊 Changes **23 files changed** (+894 additions, -327 deletions) <details> <summary>View changed files</summary> 📝 `app/Entities/Models/Chapter.php` (+1 -1) 📝 `app/Entities/Repos/ChapterRepo.php` (+23 -10) 📝 `app/Entities/Repos/PageRepo.php` (+2 -39) ➕ `app/Entities/Tools/Cloner.php` (+150 -0) 📝 `app/Facades/Activity.php` (+3 -0) 📝 `app/Http/Controllers/BookController.php` (+38 -1) 📝 `app/Http/Controllers/ChapterController.php` (+47 -0) 📝 `app/Http/Controllers/PageController.php` (+9 -11) 📝 `app/Http/Controllers/RoleController.php` (+15 -4) 📝 `resources/lang/en/entities.php` (+12 -0) ➕ `resources/views/books/copy.blade.php` (+40 -0) 📝 `resources/views/books/show.blade.php` (+6 -0) ➕ `resources/views/chapters/copy.blade.php` (+50 -0) 📝 `resources/views/chapters/show.blade.php` (+6 -0) ➕ `resources/views/entities/copy-considerations.blade.php` (+15 -0) 📝 `resources/views/pages/copy.blade.php` (+2 -0) 📝 `resources/views/settings/roles/create.blade.php` (+15 -3) 📝 `resources/views/settings/roles/edit.blade.php` (+47 -4) 📝 `resources/views/settings/roles/parts/form.blade.php` (+211 -254) 📝 `routes/web.php` (+4 -0) _...and 3 more files_ </details> ### 📄 Description As per definition at https://github.com/BookStackApp/BookStack/issues/1123#issuecomment-997232636. ### Todo - [x] Role copying - [x] Chapter copying - [x] Book copying - [x] Testing - [x] Update views to highlight considerations below? ### Considerations - Permissions will not be copied. - Page Attachments will not be copied. - Page images will not be updated nor will their relation to pages be updated. - Copied content owner will be the copier. - Due to the above, copied content could be visible to a different set of people. --- Related to #1123 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:25:19 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6137