Javascript alert when leaving editor doesn't work

Bug #185422 reported by Kit Blake
2
Affects Status Importance Assigned to Milestone
Silva
Fix Released
Medium
Unassigned

Bug Description

When a Silva Document loads in Kupu, the author cannot leave the screen without getting a javascript alert: "You have unsaved changes. Are you sure you want to leave the editor?". (This happens even if the author hasn't made any changes.)
If the author clicks "Cancel", the author leaves the editor.
If the author clicks "Ok", the author leaves the editor.
Nothing else happens. Once, clicking "Ok" saved the document, but now it does nothing. So let's change the alert to: "You have unsaved changes. Do you want to click a button?" :-) Seriously, we need to either remove the alert or make it really work. The cod is in kupu/kupusaveonpart.js

Revision history for this message
Kit Blake (kitblake) wrote :

Can you look at this?

Changed in silva:
assignee: nobody → aaltepet
importance: Undecided → Medium
milestone: none → 2.0.7
Revision history for this message
Andy Altepeter (aaltepet) wrote :

Sure, I'll try and spend some time on this tonight.

Revision history for this message
Andy Altepeter (aaltepet) wrote :

Hey Kit,
I've tried to replicate this using the Silva 2.0 and Silva Document 2.0 branches, with kupu 1.4b1, but am unable to. Did you do a refresh the browser cache? Are others at the infrae shop able to? I have never had this problem...

Changed in silva:
assignee: aaltepet → kitblake
Revision history for this message
Kit Blake (kitblake) wrote :

Just replicated this with Todd's machine (Linux, FF, Silva trunk). Here are the steps:

+ Go to a document and edit some text in Kupu.
+ Without saving, click one of the uplinks in the matrix nav (or wherever, just leave the doc)
+ A js alert should appear, asking "You have unsaved changes. Are you sure you want to leave the editor?"
+ Click "Ok". This is supposed to save your work (not very clear from the alert text).
+ Now return to the doc and check if the work was saved. In our case it's not saved.

If you click "Cancel" instead of "Ok", it won't save your work.

Changed in silva:
assignee: kitblake → aaltepet
Revision history for this message
Andy Altepeter (aaltepet) wrote :

I've checked in a fix for this in both the 2.0 branch and the trunk. Basically, Silva's kupusaveonpart.js wasn't coded to actually save the document. I changed the initial confirmation language to add "click OK to save the document and leave the editor" (or similar), and when the user clicks OK the document is actually saved.

If they click cancel, they are still given the option of leaving the editor (without saving), or really canceling the action.

Changed in silva:
status: New → Fix Committed
Changed in silva:
assignee: aaltepet → nobody
Changed in silva:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.