Bug 23100 - Notify user if leaving modified patron edit form without saving
Summary: Notify user if leaving modified patron edit form without saving
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Josef Moravec
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-12 06:35 UTC by Josef Moravec
Modified: 2023-10-08 10:42 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 23100: Add leave page confirmation to patron edit form (1.90 KB, patch)
2019-06-12 07:47 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 23100: Add leave page confirmation to patron edit form (1.98 KB, patch)
2019-06-14 18:13 UTC, Bin Wen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Josef Moravec 2019-06-12 06:35:23 UTC
We use this functionality in system preferences and in advanced cataloguing editor. It would be nice to have it on patron form too.
Comment 1 Josef Moravec 2019-06-12 07:47:36 UTC
Created attachment 90526 [details] [review]
Bug 23100: Add leave page confirmation to patron edit form

Test plan:
1) Apply the patch
2) Try to edit a patron, change some value and try to go out without
saving, you should be notified you have unsaved changes
Comment 2 Owen Leonard 2019-06-12 11:54:51 UTC
This patch seems to be working well and I think it's a good idea. However, the custom message doesn't appear for me in Firefox or Chrome. Is this expected? Is there a browser which will show the message defined in the template?
Comment 3 Bin Wen 2019-06-14 18:13:53 UTC
Created attachment 90617 [details] [review]
Bug 23100: Add leave page confirmation to patron edit form

Test plan:
1) Apply the patch
2) Try to edit a patron, change some value and try to go out without
saving, you should be notified you have unsaved changes

For me,it works on chrome and firefox

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 4 Katrin Fischer 2019-06-17 20:39:13 UTC
I've tried it in Firefox and Chrome, while both times I am asked for confirmation before leaving the page, it always shows the default message from the browser instead of the custom one.

Josef, can you have a look?

I might also change it to: You have modified this patron record, ... or You have made a change to this patron record... or similar.
Comment 5 Owen Leonard 2019-06-18 12:13:36 UTC
Looks like the parts of this patch related to adding a custom message can be removed:

https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#Browser_compatibility
Comment 6 Katrin Fischer 2019-07-13 08:41:38 UTC
Hi Josef, do you have time for a follow-up with the change Owen suggested?
Comment 7 Katrin Fischer 2023-10-08 10:42:56 UTC
Still a good idea, I think. Maybe someone would like to adopt?