Template Append to page content not working #4773

Open
opened 2026-02-05 09:14:49 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @gaetan-31 on GitHub (May 16, 2024).

Describe the Bug

Hi,
if using the Append to page content, the template not adding on page.

Steps to Reproduce

  1. Open page
  2. Click on menu
  3. Click Template
  4. Click on Append to page content button

Expected Behaviour

Append to page content when click on button

Screenshots or Additional Context

Template

Browser Details

No response

Exact BookStack Version

24.05

Originally created by @gaetan-31 on GitHub (May 16, 2024). ### Describe the Bug Hi, if using the `Append to page content`, the template not adding on page. ### Steps to Reproduce 1. Open page 2. Click on menu 3. Click Template 4. Click on `Append to page content` button ### Expected Behaviour Append to page content when click on button ### Screenshots or Additional Context ![Template](https://github.com/BookStackApp/BookStack/assets/69146174/83edcaec-9946-436a-bcdb-1c901e2f5210) ### Browser Details _No response_ ### Exact BookStack Version 24.05
OVERLORD added the 🐛 Bug label 2026-02-05 09:14:49 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 16, 2024):

Hi @gaetan-31,
This works for me in my testing on Chrome and FireFox.

  • Has this ever worked for you?
  • Does prepend (or clicking on the template item to replace content) work?
  • Does this work for you on our demo instance.
  • What browser are you using?
  • On your own instance, where this is not working, If you start a search via the main header bar, do you see the search preview load results as you type (beyond three characters) without pressing enter?
  • How did you install/run BookStack?
@ssddanbrown commented on GitHub (May 16, 2024): Hi @gaetan-31, This works for me in my testing on Chrome and FireFox. - Has this ever worked for you? - Does prepend (or clicking on the template item to replace content) work? - Does this work for you on [our demo instance](https://demo.bookstackapp.com/login?email=admin@example.com&password=password). - What browser are you using? - On your own instance, where this is not working, If you start a search via the main header bar, do you see the search preview load results as you type (beyond three characters) without pressing enter? - How did you install/run BookStack?
Author
Owner

@gaetan-31 commented on GitHub (May 17, 2024):

Does prepend (or clicking on the template item to replace content) work? => Yes
Does this work for you on our demo instance =>Yes
What browser are you using? => Test on Firefox, Chrome and Edge
On your own instance, where this is not working, If you start a search via the main header bar, do you see the search preview load results as you type (beyond three characters) without pressing enter? => Yes
How did you install/run BookStack? => with https://www.bookstackapp.com/docs/admin/installation/ & https://www.howtoforge.com/how-to-install-bookstack-on-ubuntu-20-04/

@gaetan-31 commented on GitHub (May 17, 2024): Does prepend (or clicking on the template item to replace content) work? => **Yes** Does this work for you on our demo instance =>**Yes** What browser are you using? => **Test on Firefox, Chrome and Edge** On your own instance, where this is not working, If you start a search via the main header bar, do you see the search preview load results as you type (beyond three characters) without pressing enter? => **Yes** How did you install/run BookStack? => with https://www.bookstackapp.com/docs/admin/installation/ & https://www.howtoforge.com/how-to-install-bookstack-on-ubuntu-20-04/
Author
Owner

@ssddanbrown commented on GitHub (May 17, 2024):

Thanks @gaetan-31,

I'm not really sure what's going on then if the demo works okay, and the other template actions work okay.
Can you open the browser development tools (Usually F12, Or right-click on page > Inspect element) and open the "Console" tab. Do any log messages appear in this console tab when you click the template append button? If so, can you share them?

@ssddanbrown commented on GitHub (May 17, 2024): Thanks @gaetan-31, I'm not really sure what's going on then if the demo works okay, and the other template actions work okay. Can you open the browser development tools (Usually F12, Or right-click on page > Inspect element) and open the "Console" tab. Do any log messages appear in this console tab when you click the template append button? If so, can you share them?
Author
Owner

@gaetan-31 commented on GitHub (May 27, 2024):

Hi @ssddanbrown yes that :

Uncaught (in promise) RangeError: Applying change set to a document with the wrong length
    apply https://server/dist/code.js?version=v24.05:5
    get newDoc https://server/dist/code.js?version=v24.05:5
    applyTransaction https://server/dist/code.js?version=v24.05:5
    get state https://server/dist/code.js?version=v24.05:5
    update https://server/dist/code.js?version=v24.05:10
    dispatchTransactions https://server/dist/code.js?version=v24.05:10
    dispatch https://server/dist/code.js?version=v24.05:10
    $ https://server/dist/markdown.js?version=v24.05:22
    appendContent https://server/dist/markdown.js?version=v24.05:20
    ur https://server/dist/markdown.js?version=v24.05:22
    Zi https://server/dist/app.js?version=v24.05:2
    insertTemplate https://server/dist/app.js?version=v24.05:22
3 code.js:5:6256
@gaetan-31 commented on GitHub (May 27, 2024): Hi @ssddanbrown yes that : ``` c Uncaught (in promise) RangeError: Applying change set to a document with the wrong length apply https://server/dist/code.js?version=v24.05:5 get newDoc https://server/dist/code.js?version=v24.05:5 applyTransaction https://server/dist/code.js?version=v24.05:5 get state https://server/dist/code.js?version=v24.05:5 update https://server/dist/code.js?version=v24.05:10 dispatchTransactions https://server/dist/code.js?version=v24.05:10 dispatch https://server/dist/code.js?version=v24.05:10 $ https://server/dist/markdown.js?version=v24.05:22 appendContent https://server/dist/markdown.js?version=v24.05:20 ur https://server/dist/markdown.js?version=v24.05:22 Zi https://server/dist/app.js?version=v24.05:2 insertTemplate https://server/dist/app.js?version=v24.05:22 3 code.js:5:6256 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4773