Skip to content

Discard Draft does not delete draft #3927

@ThaMunsta

Description

@ThaMunsta

Describe the Bug

A saved draft is not removed from the database by clicking Discard Draft at the top of the page.

Steps to Reproduce

  1. Create a new page (or edit an existing)
  2. Type some changes
  3. Save your draft using the link at the top of the edit page
  4. Discard your draft using the link at the top of the edit page
  5. Refresh the browser window (or open the MySQL database)
  6. You are now editing the same draft from earlier (or find the draft still in the MySQL database)

Expected Behaviour

The button named Discard Draft should remove the stored changes from the database so a user doesn't go in to edit the page later and save edits from an old draft that were not intended to be "remembered". Ideally this will also prevent the warning about unsaved changes when you are navigating away from the page.

Screenshots or Additional Context

The two buttons in question are at the top of the page and look like this:
image

Browser Details

Chrome Version 108.0.5359.125 on Windows 10 21H2

Exact BookStack Version

v22.11.1

PHP Version

PHP 8.0.25

Hosting Environment

Docker Image (linuxserver/bookstack:latest) hosted behind Nginx Proxy Manager.
Reproduced on https://demo.bookstackapp.com/ logged in as admin.
Originally discovered on older version (v21 something I believe) but looking at the docs and page-editor.js it might have been this way for a while. If it was intentional - my apologies.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions