After sorting the page order is not being saved V22.06.1 #2886

Closed
opened 2026-02-05 05:36:28 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @T3-RnD on GitHub (Jun 29, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Sorting pages within a book a new order isn't saved in the database

I have 2 servers
Local machine: Mac OS | MAMP application Apache Server | PHP 7.4 | MySQL
Production Server: Linux | Apache Server | PHP 7.4 | MySQL

In local machine, the app is working fine it's submitting the changes with a success message and the database is saving it and I can see the change in the priority column which I think is the column saving the page order inside the chapter or a book

In server-side app, same scenario is happening but the changes are not being saved in that specific column, even though I have the same code in the server-side and local machine

Exact BookStack Version

22.06.1

Log Content

No response

PHP Version

7.4

Hosting Environment

I have 2 servers
Local machine: Mac OS | MAMP application Apache Server | PHP 7.4 | MySQL
Production Server: Linux | Apache Server | PHP 7.4 | MySQL

Originally created by @T3-RnD on GitHub (Jun 29, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Sorting pages within a book a new order isn't saved in the database I have 2 servers Local machine: Mac OS | MAMP application Apache Server | PHP 7.4 | MySQL Production Server: Linux | Apache Server | PHP 7.4 | MySQL In local machine, the app is working fine it's submitting the changes with a success message and the database is saving it and I can see the change in the priority column which I think is the column saving the page order inside the chapter or a book In server-side app, same scenario is happening but the changes are not being saved in that specific column, even though I have the same code in the server-side and local machine ### Exact BookStack Version 22.06.1 ### Log Content _No response_ ### PHP Version 7.4 ### Hosting Environment I have 2 servers Local machine: Mac OS | MAMP application Apache Server | PHP 7.4 | MySQL Production Server: Linux | Apache Server | PHP 7.4 | MySQL
OVERLORD added the 🐕 Support label 2026-02-05 05:36:28 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 29, 2022):

Thanks @T3-RnD,

On the production machine, what was the install method? Did you follow a specific guide or script?
Also, what is the operating system in use?

@ssddanbrown commented on GitHub (Jun 29, 2022): Thanks @T3-RnD, On the production machine, what was the install method? Did you follow a specific guide or script? Also, what is the operating system in use?
Author
Owner

@T3-RnD commented on GitHub (Jun 29, 2022):

Not really, I added the connection between my repository and the server through cPanel guides and installing the app I followed your guide
image
and after that everything went smooth until I face this issue

The OS on the server-side is Linux

@T3-RnD commented on GitHub (Jun 29, 2022): Not really, I added the connection between my repository and the server through cPanel guides and installing the app I followed your guide ![image](https://user-images.githubusercontent.com/104494713/176447686-b2c0a0ff-e3f3-433e-89f4-5a4fbb7aa388.png) and after that everything went smooth until I face this issue The OS on the server-side is Linux
Author
Owner

@ssddanbrown commented on GitHub (Jun 29, 2022):

Alrighty, do you have access to control "ModSecurity" within cPanel?
If so, please try turning this off temporarily to see if that fixes the issue.

@ssddanbrown commented on GitHub (Jun 29, 2022): Alrighty, do you have access to control "ModSecurity" within cPanel? If so, please try turning this off temporarily to see if that fixes the issue.
Author
Owner

@T3-RnD commented on GitHub (Jun 29, 2022):

I just disabled it and I cleared all cache in the system and I tried again, still not working

@T3-RnD commented on GitHub (Jun 29, 2022): I just disabled it and I cleared all cache in the system and I tried again, still not working
Author
Owner

@ssddanbrown commented on GitHub (Jun 29, 2022):

Alright, It's hard to see what's failing at the moment.

Within this file: app/Http/Controllers/BookSortController.php

Could you find the lines highlighted here:
a721405202/app/Http/Controllers/BookSortController.php (L56-L57)

and above them, add the following line:

dd($request->get('sort-tree'));

This should stop the sort action and spit out the sort data on save, I just need to know what you then see after doing the above then saving the sort. Ensure you make some sort changes when doing these steps.

@ssddanbrown commented on GitHub (Jun 29, 2022): Alright, It's hard to see what's failing at the moment. Within this file: `app/Http/Controllers/BookSortController.php` Could you find the lines highlighted here: https://github.com/BookStackApp/BookStack/blob/a7214052024d1f16625f6e71e0bef6cc12ad0952/app/Http/Controllers/BookSortController.php#L56-L57 and **_above_** them, add the following line: ```php dd($request->get('sort-tree')); ``` This should stop the sort action and spit out the sort data on save, I just need to know what you then see after doing the above then saving the sort. Ensure you make some sort changes when doing these steps.
Author
Owner

@T3-RnD commented on GitHub (Jun 29, 2022):

image

@T3-RnD commented on GitHub (Jun 29, 2022): ![image](https://user-images.githubusercontent.com/104494713/176456036-7c3d17cb-9a84-4d05-8b05-ffe03638be0a.png)
Author
Owner

@ssddanbrown commented on GitHub (Jun 29, 2022):

Okay that confirms the data is getting through the webserver okay.
Struggling to think why this might occur.

  • Are you using an admin-level bookstack user when performing this sort?
  • Do you have a way to check active PHP extensions? Especially that the JSON extension is active.
    • Alternatively, if possible, you could try updating to PHP8 where this is built-in to PHP.

You can remove that debug line now we've confirmed the data is getting though.

@ssddanbrown commented on GitHub (Jun 29, 2022): Okay that confirms the data is getting through the webserver okay. Struggling to think why this might occur. - Are you using an admin-level bookstack user when performing this sort? - Do you have a way to check active PHP extensions? Especially that the JSON extension is active. - Alternatively, if possible, you could try updating to PHP8 where this is built-in to PHP. You can remove that debug line now we've confirmed the data is getting though.
Author
Owner

@ssddanbrown commented on GitHub (Jul 7, 2022):

Since there's been no follow-up I'm going to close this. If the issue remains and is something you still require to be fixed respond to my previous comment and this can then be re-opened.

@ssddanbrown commented on GitHub (Jul 7, 2022): Since there's been no follow-up I'm going to close this. If the issue remains and is something you still require to be fixed respond to my previous comment and this can then be re-opened.
Author
Owner

@mrcompsci commented on GitHub (Aug 10, 2022):

I'm seeing the same issue on version 22.04. It was upgraded a few months ago from v0.29 and hasn't been able to sort pages within a book ever since.

Sorting does not work with an admin-level user. The system is running PHP 7.4 with the JSON extension active. I confirmed in MySQL that the priority field in the pages tables is not getting updated. Manually updating that field causes pages to be sorted as expected.

@mrcompsci commented on GitHub (Aug 10, 2022): I'm seeing the same issue on version 22.04. It was upgraded a few months ago from v0.29 and hasn't been able to sort pages within a book ever since. Sorting does not work with an admin-level user. The system is running PHP 7.4 with the JSON extension active. I confirmed in MySQL that the _priority_ field in the _pages_ tables is not getting updated. Manually updating that field causes pages to be sorted as expected.
Author
Owner

@ssddanbrown commented on GitHub (Aug 11, 2022):

@mrcompsci Feel free to open an new issue if you have this issue, so that you can detail your environment. Note though, Only the latest version of BookStack is supported, Ideally I'd want confirmation this issue exists for you on the latest version.

@ssddanbrown commented on GitHub (Aug 11, 2022): @mrcompsci Feel free to open an new issue if you have this issue, so that you can detail your environment. Note though, Only the latest version of BookStack is supported, Ideally I'd want confirmation this issue exists for you on the latest version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2886