Adding a non-existent tag to a chapter requires to save twice. #3414

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

Originally created by @Pafzedog on GitHub (Dec 27, 2022).

Describe the Bug

When adding an unknown tag to a chapter, the first click on the save button does not work properly.

Steps to Reproduce

  1. Go to a chapter
  2. Edit the chapter
  3. Add an un-existing tag
  4. click on "Save chapter"
  5. A new "Tag field" appears under the previously entered tag.
  6. Chapter and new tag are not saved

Expected Behaviour

Chapter is saved and also the new Tag

Screenshots or Additional Context

image
image

Browser Details

102.6.0esr (64 bits) on Windows

Exact BookStack Version

22.11 and actual demo version

PHP Version

7.4.33

Hosting Environment

Debian 11 LXC on proxmox
manual installation with nginx

Originally created by @Pafzedog on GitHub (Dec 27, 2022). ### Describe the Bug When adding an unknown tag to a chapter, the first click on the save button does not work properly. ### Steps to Reproduce 1. Go to a chapter 2. Edit the chapter 3. Add an un-existing tag 4. click on "Save chapter" 5. A new "Tag field" appears under the previously entered tag. 6. Chapter and new tag are not saved ### Expected Behaviour Chapter is saved and also the new Tag ### Screenshots or Additional Context ![image](https://user-images.githubusercontent.com/8932092/209643239-bfc68683-3da5-4ee9-a629-65c8438e192d.png) ![image](https://user-images.githubusercontent.com/8932092/209643275-b408068e-ee79-4291-9bfd-c49aca326e56.png) ### Browser Details 102.6.0esr (64 bits) on Windows ### Exact BookStack Version 22.11 and actual demo version ### PHP Version 7.4.33 ### Hosting Environment Debian 11 LXC on proxmox manual installation with nginx
OVERLORD added the 🐛 Bug label 2026-02-05 06:38:17 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 27, 2022):

Just tried to replicate on our demo instance, using Firefox 107.0.1 on MacOS, and could not get the issue to occur.
Will need to check specifically against ESR.

@ssddanbrown commented on GitHub (Dec 27, 2022): Just tried to replicate on our demo instance, using Firefox 107.0.1 on MacOS, and could not get the issue to occur. Will need to check specifically against ESR.
Author
Owner

@Pafzedog commented on GitHub (Dec 27, 2022):

strange ...
I just tried with Edge browser on your demo instance and same behaviour
image

I'll try later with another computer and also another network

@Pafzedog commented on GitHub (Dec 27, 2022): strange ... I just tried with Edge browser on your demo instance and same behaviour ![image](https://user-images.githubusercontent.com/8932092/209663556-993c974c-f7da-4786-a0c8-8e0193df06d3.png) I'll try later with another computer and also another network
Author
Owner

@linyiman commented on GitHub (Dec 27, 2022):

good

@linyiman commented on GitHub (Dec 27, 2022): good
Author
Owner

@linyiman commented on GitHub (Dec 27, 2022):

#3409 good

@linyiman commented on GitHub (Dec 27, 2022): #3409 good
Author
Owner

@Pafzedog commented on GitHub (Dec 27, 2022):

Just tested it on another computer and another network and it's same behavior.
let met explain further :
Page and Tag will not be saved unless, before clicking on "Save button", I click in "Tag Value" field or anywhere else. There is some kind of "trigger event" that validate the entry and display a new row to add another tag as I click eveywhere and obviously on the "Save" Button.

@Pafzedog commented on GitHub (Dec 27, 2022): Just tested it on another computer and another network and it's same behavior. let met explain further : Page and Tag will not be saved unless, before clicking on "Save button", I click in "Tag Value" field or anywhere else. There is some kind of "trigger event" that validate the entry and display a new row to add another tag as I click eveywhere and obviously on the "Save" Button.
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2023):

@Pafzedog Thanks for testing further.

Just tested this again on chromium Version 109.0.5414.74 (Official Build) snap (64-bit) and Firefox 109.0 (64-bit) on Linux, across both my dev instance and the demo instance and still cannot reproduce.

I'm also was not ever, without hacking, able to submit the form without triggering the new row to display. I'd click the save button but it would jump from the cursor due to the new row popping in.
Even when doing some hacker to submit the form while I'm still in the tag name input, the value would submit as expected, which meets my expectations since the tag inputs should always have a valid name assigned, and it's just using normal HTML form functionality, so they'd be part of the form submission.

@ssddanbrown commented on GitHub (Jan 26, 2023): @Pafzedog Thanks for testing further. Just tested this again on chromium `Version 109.0.5414.74 (Official Build) snap (64-bit)` and Firefox `109.0 (64-bit)` on Linux, across both my dev instance and the demo instance and still cannot reproduce. I'm also was not ever, without hacking, able to submit the form without triggering the new row to display. I'd click the save button but it would jump from the cursor due to the new row popping in. Even when doing some hacker to submit the form while I'm still in the tag name input, the value would submit as expected, which meets my expectations since the tag inputs should always have a valid name assigned, and it's just using normal HTML form functionality, so they'd be part of the form submission.
Author
Owner

@Pafzedog commented on GitHub (Jan 26, 2023):

Don't you have to click twice on save button when adding a brand new tag ?
firefox_8bfxakXfcW

@Pafzedog commented on GitHub (Jan 26, 2023): Don't you have to click twice on save button when adding a brand new tag ? ![firefox_8bfxakXfcW](https://user-images.githubusercontent.com/8932092/214861189-6bb2c818-ffa8-491a-b089-d9eb4072373e.gif)
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2023):

Oooooh, I totally understand you now, sorry for the confusion. I thought you meant the chapter was saved but the tag was not.
Yeah, technically you are never actually clicking the button in the above steps, it moves before you have the chance to complete the click.

Might have to tweak this to add the new row sooner, when input is is started for the previous tag rather than on un-focus.

@ssddanbrown commented on GitHub (Jan 26, 2023): Oooooh, I totally understand you now, sorry for the confusion. I thought you meant the chapter was saved but the tag was not. Yeah, technically you are never actually clicking the button in the above steps, it moves before you have the chance to complete the click. Might have to tweak this to add the new row sooner, when input is is started for the previous tag rather than on un-focus.
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2023):

Thanks again @Pafzedog for reporting this. I've now pushed 3202f96181 which will add the row on input change, long before moving to press the button.
Will be part of the next feature release.

@ssddanbrown commented on GitHub (Jan 26, 2023): Thanks again @Pafzedog for reporting this. I've now pushed 3202f96181385c7a05ca3c40f7a4566cc1a6fa7a which will add the row on input change, long before moving to press the button. Will be part of the next feature release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3414