unable to save draft #3912

Closed
opened 2026-02-05 07:51:06 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @TomBachelot on GitHub (Jul 12, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

When creating a new page in bookstack the draft won't save, the creation of the page itself is saved, it appears on the home page as a new page on the draft part but all the content inserted in the draft is never saved.

The green button is not working :
image

There is a JS error :
image

Exact BookStack Version

v23.06.1

Log Content

app.js?version=v23.06.1:43 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getContent')
at ar.getContent (app.js?version=v23.06.1:43:2354)
at On.saveDraft (app.js?version=v23.06.1:25:8246)
at On.runAutoSave (app.js?version=v23.06.1:25:8096)
getContent @ app.js?version=v23.06.1:43
saveDraft @ app.js?version=v23.06.1:25
runAutoSave @ app.js?version=v23.06.1:25

PHP Version

PHP Version 8.2.4

Hosting Environment

windows 10 on xampp

Originally created by @TomBachelot on GitHub (Jul 12, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario When creating a new page in bookstack the draft won't save, the creation of the page itself is saved, it appears on the home page as a new page on the draft part but all the content inserted in the draft is never saved. The green button is not working : ![image](https://github.com/BookStackApp/BookStack/assets/63355832/b5a0311c-eb64-4514-a876-d81fba4f0693) There is a JS error : ![image](https://github.com/BookStackApp/BookStack/assets/63355832/780f4079-23ea-4018-aea7-3af82380095d) ### Exact BookStack Version v23.06.1 ### Log Content app.js?version=v23.06.1:43 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getContent') at ar.getContent (app.js?version=v23.06.1:43:2354) at On.saveDraft (app.js?version=v23.06.1:25:8246) at On.runAutoSave (app.js?version=v23.06.1:25:8096) getContent @ app.js?version=v23.06.1:43 saveDraft @ app.js?version=v23.06.1:25 runAutoSave @ app.js?version=v23.06.1:25 ### PHP Version PHP Version 8.2.4 ### Hosting Environment windows 10 on xampp
OVERLORD added the 🐕 Support label 2026-02-05 07:51:06 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 12, 2023):

Hi @TomBachelot,
Based upon the screenshot, it looks like this is caused by a more significant issue of the WYSIWYG editor not loading properly.

  • Can you confirm if you're able to write within the editor?
  • Can you reload the edit view, while keeping the screenshotted devtools open, then share any initial/earlier errors you see.
@ssddanbrown commented on GitHub (Jul 12, 2023): Hi @TomBachelot, Based upon the screenshot, it looks like this is caused by a more significant issue of the WYSIWYG editor not loading properly. - Can you confirm if you're able to write within the editor? - Can you reload the edit view, while keeping the screenshotted devtools open, then share any initial/earlier errors you see.
Author
Owner

@TomBachelot commented on GitHub (Jul 12, 2023):

Hi @ssddanbrown thank you for your quick respond

  • Yes, I can write in the editor without any problem, it works perfectly.
    image
    but if i reload the page without save it the draft won't save what i wrote

  • here is the screenshot of the devtool
    image

@TomBachelot commented on GitHub (Jul 12, 2023): Hi @ssddanbrown thank you for your quick respond - Yes, I can write in the editor without any problem, it works perfectly. ![image](https://github.com/BookStackApp/BookStack/assets/63355832/01fff398-94c2-426d-9e3b-13b14779069e) but if i reload the page without save it the draft won't save what i wrote - here is the screenshot of the devtool ![image](https://github.com/BookStackApp/BookStack/assets/63355832/f3d927c4-29a2-4557-b121-163d9cb012f7)
Author
Owner

@ssddanbrown commented on GitHub (Jul 12, 2023):

Thanks for confirming, I still feel the problem lays elsewhere though, the edit area should not be grey, so I feel the editor is not fully loading as required.

  • Do you have any customizations active? Including via the "Custom HTML Head Content" setting.
  • Can you confirm the output of running git status from your BookStack installation directory?
@ssddanbrown commented on GitHub (Jul 12, 2023): Thanks for confirming, I still feel the problem lays elsewhere though, the edit area should not be grey, so I feel the editor is not fully loading as required. - Do you have any customizations active? Including via the "Custom HTML Head Content" setting. - Can you confirm the output of running `git status` from your BookStack installation directory?
Author
Owner

@TomBachelot commented on GitHub (Jul 12, 2023):

The editing area has always been grey when editing for me since the beginning, so I don't see what the problem is ?

  • Yes I do have active customizations via the "Custom HTML Head Content" :
    Custom HTML Head Content.txt

  • here is the output of the git status command
    image
    image

@TomBachelot commented on GitHub (Jul 12, 2023): The editing area has always been grey when editing for me since the beginning, so I don't see what the problem is ? - Yes I do have active customizations via the "Custom HTML Head Content" : [Custom HTML Head Content.txt](https://github.com/BookStackApp/BookStack/files/12029158/Custom.HTML.Head.Content.txt) - here is the output of the git status command ![image](https://github.com/BookStackApp/BookStack/assets/63355832/3ebbaa42-ea21-4838-9559-def59736f93d) ![image](https://github.com/BookStackApp/BookStack/assets/63355832/39fd3dfd-eb20-4b05-a27b-e2cac6a73e39)
Author
Owner

@ssddanbrown commented on GitHub (Jul 12, 2023):

It's the first script tag in your custom head customizations that's causing problems.
You should not be calling tinymce.init.

Keep in mind that all such customizations are not supported. Always try temporarily removing these first upon coming across issues, especially if making quite extension customizations like you are here.

Also, the amount of changed files isn't great and could interfere with updates. Might just be file permissions though.
Worth running git config core.fileMode false and see if git status provides a cleaner result.

@ssddanbrown commented on GitHub (Jul 12, 2023): It's the first script tag in your custom head customizations that's causing problems. You should not be calling `tinymce.init`. Keep in mind that all such customizations are not supported. Always try temporarily removing these first upon coming across issues, especially if making quite extension customizations like you are here. Also, the amount of changed files isn't great and could interfere with updates. Might just be file permissions though. Worth running `git config core.fileMode false` and see if `git status` provides a cleaner result.
Author
Owner

@TomBachelot commented on GitHub (Jul 13, 2023):

Thank you, amazing it's working perfectly ! In deed the edit area is now white :)

Alright I'll keep in mind your advices. Thank you.

I did run the command but i still got the same output than before.

image
image

Execpt the first two script in my "Custom HTML Head Content" the others are comming from your hack documentation.

@TomBachelot commented on GitHub (Jul 13, 2023): Thank you, amazing it's working perfectly ! In deed the edit area is now white :) Alright I'll keep in mind your advices. Thank you. I did run the command but i still got the same output than before. ![image](https://github.com/BookStackApp/BookStack/assets/63355832/295bf192-7f6f-4b2c-b59a-4c5a911b2d9e) ![image](https://github.com/BookStackApp/BookStack/assets/63355832/544b4106-9b84-4f3a-978c-ccc5e14fac7c) Execpt the first two script in my "Custom HTML Head Content" the others are comming from your hack documentation.
Author
Owner

@ssddanbrown commented on GitHub (Jul 13, 2023):

Good to hear that worked!

Execpt the first two script in my "Custom HTML Head Content" the others are comming from your hack documentation.

Just keep in mind that the hacks are not supported either, they can cause issues with later BookStack versions.

I did run the command but i still got the same output than before.

That's a little worrying.
Things appear to be in a bit of a messy state.
I could help get things back into a clean state, but would need to know:

  • Have you made edits to any core app files outside of the .env file and themes/ folder?
  • What is the current output of running the git pull origin release upgrade step.
  • What is the current output of running git diff .env.example
@ssddanbrown commented on GitHub (Jul 13, 2023): Good to hear that worked! > Execpt the first two script in my "Custom HTML Head Content" the others are comming from your hack documentation. Just keep in mind that the hacks are not supported either, they can cause issues with later BookStack versions. > I did run the command but i still got the same output than before. That's a little worrying. Things appear to be in a bit of a messy state. I could help get things back into a clean state, but would need to know: - Have you made edits to any core app files outside of the `.env` file and `themes/` folder? - What is the current output of running the `git pull origin release` upgrade step. - What is the current output of running `git diff .env.example`
Author
Owner

@TomBachelot commented on GitHub (Jul 13, 2023):

Have you made edits to any core app files outside of the .env file and themes/ folder?

yes i did, here is the list of all the files :
image

What is the current output of running the git pull origin release upgrade step.

image
image
image

What is the current output of running git diff .env.example

image

@TomBachelot commented on GitHub (Jul 13, 2023): > Have you made edits to any core app files outside of the .env file and themes/ folder? yes i did, here is the list of all the files : ![image](https://github.com/BookStackApp/BookStack/assets/63355832/881bd4a0-2d41-43a2-94b1-fd8295d8bce3) > What is the current output of running the git pull origin release upgrade step. ![image](https://github.com/BookStackApp/BookStack/assets/63355832/85491e95-44ad-4742-849f-050104494307) ![image](https://github.com/BookStackApp/BookStack/assets/63355832/f4e878b0-ed65-459d-9d2f-685f351e0827) ![image](https://github.com/BookStackApp/BookStack/assets/63355832/88db4d5e-c1fb-43ee-9880-f72b0f18306f) > What is the current output of running git diff .env.example ![image](https://github.com/BookStackApp/BookStack/assets/63355832/9b05cc32-ad87-4ec3-ac7f-acc667ea31fd)
Author
Owner

@ssddanbrown commented on GitHub (Jul 18, 2023):

Okay, I'll close this off since the original issue is now solved.

In regard to other files, the app files are not intended to be edited so editing with custom changes will likely cause conflicts and issues when it comes to updating, like it appears to have done here.

You can often reset the state of things by running git reset --hard but first consider:

  • This will remove any of the custom changes you've intended to make.
  • You should backup all files within your BookStack directory just in case this does not go correctly.
@ssddanbrown commented on GitHub (Jul 18, 2023): Okay, I'll close this off since the original issue is now solved. In regard to other files, the app files are not intended to be edited so editing with custom changes will likely cause conflicts and issues when it comes to updating, like it appears to have done here. You can often reset the state of things by running `git reset --hard` **but first** consider: - This will remove any of the custom changes you've intended to make. - You should backup all files within your BookStack directory just in case this does not go correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3912