webclient: No warning prompt when leaving MARC editor without saving

Bug #1538678 reported by Kathy Lussier on 2016-01-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When making changes to a record in MARC editor, if you leave the window without saving, there is no warning alerting the user that there are unsaved changes on the record. We need a prompt here similar to the one that is used in the vol/copy editor.

Andrea Neiman (aneiman) wrote :

In 2.12, if I try to navigate away from an unsaved record in MARC Editor, I do get the warning popup that changes may not be saved. Assuming this must've been fixed at some point?

Kathy Lussier (klussier) wrote :

Hi Andrea,

I was about to agree with you because I know I've seen the warning prompt come up, but I just re-tested. I still come across the problem when I create a new MARC record, start entering text, and then start navigating away from the screen. Can you try that workflow and let me know if you see the same thing?

Andrea Neiman (aneiman) wrote :

Tried the new record workflow and I do see the same thing you do.

I wonder if the new record behavior is related to this: https://bugs.launchpad.net/evergreen/+bug/1491875

Kyle Huckins (khuckins) wrote :

Branch pushed here: http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/khuckins/lp1538678-marc-editor-warning-prompt

This seems to work on the flat text editor and the regular editor, but certain fields outside the flat editor don't seem to play nice. Not entirely sure why this is yet

Kathy Lussier (klussier) wrote :

I've loaded this branch, but I have been unable to produce a warning prompt in any editor when creating a MARC record.

Adding a further note that on a stock system without this patch, I am no longer getting a prompt when editing a MARC record, so it looks like something may have broken the piece that was previously working.

Kathy Lussier (klussier) wrote :

Looking at some older 2.12 systems, I'm beginning to wonder whether the warning prompt displayed consistently at all, even when editing MARC records. I was just on a 2.12.0 system, which is what was current at the time Andrea and I reported our previous results, and I was unable to trigger the warning prompt while editing MARC records. I was able to trigger it once when using a later 2.12 system, but was unable to replicate it on subsequent attempts. In any case, the patch still isn't causing the prompt to appear.

Kyle Huckins (khuckins) wrote :

I was able to get it working on either fields 100 or 245 - I don't have the patch loaded up just now, but one of the fields with author information was one I was able to consistently get working here. This patch edits the MARC Edit interface, which I assumed was the one this issue is affecting, but based on this conversation I'm not so certain now.

Kathy Lussier (klussier) wrote :

Hi Kyle,

Yes, it was the MARC Edit interface, but in previous testing, Andrea and I found the prompt appeared as expected when editing a MARC record, but not when creating a new MARC record. The same interface is used for both editing and record creation, but it appeared as if it only worked under the editing scenario. Now, I'm rarely able to get the prompt to appear in either scenario.

With the patch loaded, I did try editing the 245 and 100, but I still didn't get the prompt to appear. <sadface>

Andrea Neiman (aneiman) wrote :

I took another look at this in a 3.0.0 test system, the mlnc4.noblenet.org 2.12.5 test system, and an older 2.12.1 test system. Chrome for all three versions.

(note that my 3.0 system does not have this patch loaded)

In 3.0, I do not get any warnings when navigating away from an unsaved new record or an unsaved edited record.

However, in 2.12.5 as well as in 2.12.1, I do still see the expected warning when navigating away from an unsaved edited record. I do not see the warning when navigating away from an unsaved new record.

Kathy Lussier (klussier) wrote :

OK, I think I have a clue. I'm testing this on the same 2.12.5 server as Andrea, but I'm not seeing the same behavior she sees. I still cannot get the warning prompt to appear. We are both using the same browser (Chrome 62), but we are on a different OS, so I tried again using Chrome 62 on a Windows system. I'm still not seeing the warning prompt.

However, I do see the following message in the browser console when trying navigate away from the form while editing a MARC record:

Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

I'm a bit puzzled, since I do interact with the form before I try to navigate away from the page, but it looks like this feature is new to Chrome 60 (released in July), which explains why the behavior has changed since our previous testing.

This explains why the previous behavior is broken, but does not explain why creation of a new MARC record never worked. Testing on the 2.12.5 system and on the master system with Kyle's patch, I do NOT see that console message when navigating away from the interface while creating a new MARC record. It looks like the client is never attempting to invoke the beforeunload event in that scenario. Kyle, I still wasn't able to get the warning to appear when I switched to my Windows system.

Kathy Lussier (klussier) wrote :

Adding a note that I still get unsaved warnings for the patron editor. Can we borrow whatever is used there for the MARC editor?

Andrea Neiman (aneiman) on 2018-04-30
tags: added: cataloging
Kyle Huckins (khuckins) on 2019-04-15
Changed in evergreen:
assignee: nobody → Kyle Huckins (khuckins)
Kyle Huckins (khuckins) wrote :

I've taken a new look at this, and pushed up a fix here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/khuckins/lp1538678-no-warning-prompt-marc-editor

This works by setting up a watcher in the marcedit directive for dirty input. Previously it was only in the cataloging app.js, and specific to instances containing an opac iframe.

Changed in evergreen:
assignee: Kyle Huckins (khuckins) → nobody
tags: added: pullrequest
Bill Erickson (berick) wrote :

Thanks, Kyle. Can you please move the unsaved warning message from a bare string in the JS to an egString entry defined in the template so it's translatable?

Kyle Huckins (khuckins) wrote :

New commit pushed moving that string to an egStrings entry

Bill Erickson (berick) on 2019-05-20
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Bill Erickson (berick) wrote :

Thanks, Kyle. Confirmed this fixes the create-new-mark work flow and also works on the record detail MARC Edit tab as expected. Merged to 3.2 and above.

Changed in evergreen:
milestone: none → 3.3.1
status: New → Fix Committed
assignee: Bill Erickson (berick) → nobody
Terran McCanna (tmccanna) wrote :

Dan Pearl has a signoff branch here:


tags: added: signedoff
Jason Stephenson (jstephenson) wrote :

It's already fix committed as of last night, so Dan's sign off, while nice, is too late to make a difference. It's good to know that someone else verified the fix, though.

Changed in evergreen:
milestone: 3.3.1 → 3.3.2
Meg Stroup (mstroup) wrote :

Also late to the party, but tested on MOBIUS 3.3.0 sandbox during May 2019 bug squashing. Using Chrome (version 74-odd), attaching screenshot of dialog box for further verification.

Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers