Manual sort of pages/chapters in a book does not work #6118
Labels
No labels
Focus: A11y
Focus: Admin/Meta
Focus: Authentication
Focus: Back-End
Focus: Database
Focus: Design & UX
Focus: Editor - Markdown
Focus: Editor - WYSIWYG
Focus: Export System
Focus: Front-End
Focus: Translations
Focus: View Customization
Is: Docs Update
Is: Enhancement
Is: Priority
Is: Security
Is: Upstream
Status
Blocked
Status
Open to discussion
Status
Out of scope
Status
Pending Validation
Type
API Request
Type
Bug Report
Type
Feature Request
Type
Happy feedback
Type
Maintenance
Type
Question
Type
Support
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
bookstack/bookstack#6118
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the Bug
I have a book (on a shelf) and that book has several chapters, some with pages and some without pages; it also has a few individual pages that are not part of a chapter. I am trying to move one of those 'individual pages' into an existing chapter by using the 'sort' function available on the 'book' page.
The sort page is correctly opened and I can move things around, including moving the page into the chapter. when I click 'Save New Order' the UI goes back to the book page with a little popup indicating the change was saved successfully, but the page has not actually moved.
Upon further testing, it seems I cannot change the order or location of individual pages, but I can change the order of pages that are already in a chapter. I can also reorder chapters. Just not individual pages that are outside any chapter.
I assume this is a bug as the UI does allow me to make these modifications and confirms my changes are saved. I can imagine "moving a page into a chapter" and "changing the sort order of pages" could be considered two separate actions, but neither of these work (for individual pages).
I did not try moving a page from within a chapter to outside it as I don't want to risk "irreversible damage" to my book :) As I am not a sysadmin on 'our' bookstack I don't know for sure what version we are on, but it's generally kept up to date, so it should be the latest release or the second latest if it's less than a month or so old. I am by the way 'owner' of the book and the shelf that the book is on.
I see one resolved sorting issue that is somewhat similar but not exactly: #4700 which is different because the example shown there (2 pages inside a chapter) does work for me; and one open issue #5074 which describes the same situation as 4700 (2 pages inside a chapter) and thus is not the same as my issue.
Steps to Reproduce
Go to a book, click on 'sort', move a page that is in the book (but not in a chapter) into an existing chapter, click 'save'.
Expected Behaviour
Sort order is updated and visible on the reloaded 'book' page
Screenshots or Additional Context
No response
Browser Details
Edge 146.0.3856.97 (Official build) (arm64) on MacOS Sequoia 15.7.5 (24G624)
Exact BookStack Version
undetermined, but latest or second-latest. If critical can find out next week
I just spent half an hour trying to figure out a similar problem, only to find out that I didn't have the necessary permissions for the page.
Have you checked whether you have delete permissions on the page you want to move? Update permissions alone aren’t enough.
Or ask your admins if they can change the order. If it works for them, this would suggest a permission issue.
Unfortunately, if the necessary permissions are missing, Bookstack silently fails to process the distinct sort item, while the sort-command itself reports being succesful. A corresponding error message in the UI would be helpful.
@mueller-contria wrote in #6118 (comment):
To elaborate on this, as I have also encountered this issue on a bookstack instance:
When "moving" something (pages across chapters / books, or chapters across books) the user needs the delete permission on the original location and the create permission on the new one. When "reordering", these permissions are not necessary.
Whether or not an operation is considered "moving" is triggered by the variable
$hasNewParentat$hasNewParent = $newBook->id !== $model->book_id || ($model instanceof Page && $model->chapter_id !== ($sortMapItem->parentChapterId ?? 0));Re-ordering pages within a chapter or re-ordering chapters within a book does not count as moving, but re-ordering pages within a book (the page's parent being a book) does count as moving. I believe that the latter is unintended behavior.
At least on our instance, giving the appropriate permissions (delete and create on all items) does allow all reordering and moving.