Editing a page creates an unknown error #1335

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

Originally created by @Bolthier on GitHub (Sep 1, 2019).

This is probably more on the support part, as I'm not exactly sure what is causing the issue on my instance. The only thing I could do was restoring the last version.

Describe the bug
While editing a page an unknown error occurs. Everything else on the website works as intended.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create a page or edit a page
  2. See error message

Expected behavior
Editor to appear.

Error
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'template' in 'where clause' (SQL: select count(*) as aggregate from pages where (draft = 0 or (draft = 1 and created_by = 3)) and (exists (select * from joint_permissions where pages.id = joint_permissions.entity_id and joint_permissions.entity_type = BookStack\Page and role_id in (5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 31) and action = view and (has_permission = 1 or (has_permission_own = 1 and created_by = 3)))) and draft = 0 and template = 1)

Screenshots
image

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.27.2
  • PHP Version: 7.2.19
  • Hosting Method (Nginx/Apache/Docker): Apache 2
Originally created by @Bolthier on GitHub (Sep 1, 2019). This is probably more on the support part, as I'm not exactly sure what is causing the issue on my instance. The only thing I could do was restoring the last version. **Describe the bug** While editing a page an unknown error occurs. Everything else on the website works as intended. **Steps To Reproduce** Steps to reproduce the behavior: 1. Create a page or edit a page 2. See error message **Expected behavior** Editor to appear. **Error** SQLSTATE[42S22]: Column not found: 1054 Unknown column 'template' in 'where clause' (SQL: select count(*) as aggregate from `pages` where (`draft` = 0 or (`draft` = 1 and `created_by` = 3)) and (exists (select * from `joint_permissions` where `pages`.`id` = `joint_permissions`.`entity_id` and `joint_permissions`.`entity_type` = BookStack\Page and `role_id` in (5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 31) and `action` = view and (`has_permission` = 1 or (`has_permission_own` = 1 and `created_by` = 3)))) and `draft` = 0 and `template` = 1) **Screenshots** ![image](https://user-images.githubusercontent.com/42382626/64076352-1fc26280-ccc4-11e9-82d8-5bb86e5ac3c6.png) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v0.27.2 - PHP Version: 7.2.19 - Hosting Method (Nginx/Apache/Docker): Apache 2
OVERLORD added the 🐕 Support label 2026-02-05 00:38:10 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 1, 2019):

Hi @Bolthier,
Sounds very similar to #1617, Can you try running the migration command again and see if that gets things working again?

@ssddanbrown commented on GitHub (Sep 1, 2019): Hi @Bolthier, Sounds very similar to #1617, Can you try running the migration command again and see if that gets things working again?
Author
Owner

@Bolthier commented on GitHub (Sep 1, 2019):

I will. Probably on the next weekend again.

Thank you for the response. I'll close this issue after updating.

@Bolthier commented on GitHub (Sep 1, 2019): I will. Probably on the next weekend again. Thank you for the response. I'll close this issue after updating.
Author
Owner

@ssddanbrown commented on GitHub (Dec 17, 2020):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Dec 17, 2020): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1335