Hi,
Installed the module and notice that I get this popup message:

Are you sure you want to navigate away from this page?
Be aware, if you press "OK" now, ALL your changes will be lost!
Press OK to continue, or Cancel to stay on the current page.

when the Save or Preview buttons are pressed or if I click on any other link that will navigate away such as Administer.
This isn't right... am I missing something? If I'm clicking Save, I should not get the message warning me that data will be lost...

Thanks for reviving the much-needed content lock concept in this module!

Comments

EugenMayer’s picture

Well no this is not supposed to happen. Actually there is a whitelist of paths where the JS-handler should not fire. What forms are you editting on?

steveray’s picture

It happens on the standard default content types and on custom types. I've observed that the data loss warning doesn't show on the first save creating the node, only on subsequent edits of that node.

I'm wondering if there's a conflict with another module... I tried this on a test site and did not observe the same issue. I did notice there that the loss warning does not show if navigating away from the preview page, even though loss will occur... but that's a different issue.

EugenMayer’s picture

Well i have a other guess: Could it be you are not using clean-urls?

There is no locking at all on creationg of new nodes, as this does not make any sense :)

steveray’s picture

I'm using clean URLs, always have.

Agreed on no locking on new nodes, though the data loss problem is just as real on the new node as it is when editing an existing node. I think that if it's going to warn about data loss on existing nodes then it should warn on new ones as well, just to be consistent. Otherwise, it isn't solving the problem thoroughly and should be disabled to make room for another data loss warning module to take it's place.

EugenMayer’s picture

agreed steve, i guess this is for a feature request, would be great if you can open it.

But we still did not fix your issue yet. Can you use Firebug and check, what URL you are posting to?

j0e’s picture

Hi Eugen, Thanks for this module; the behavior mentioned in the original post above happened to me when i overrode the automatic url alias in my page content type and posted to mysite.com/node/add-help.

EugenMayer’s picture

Can you please give me the action of the form ( so the url the form is posted to ). Thanks

j0e’s picture

it was mysite.com/node/198/edit and the url created was: mysite.com/node/add-help ... i wrote that in my last post, so i'm not sure if perhaps you're asking for something else...

EugenMayer’s picture

Status: Active » Closed (duplicate)
oliverpolden’s picture

I don't think this is a duplicate of http://drupal.org/node/821302 and so this issue should still be open.

I've seen this issue also. Clicking on the 'Save' button brings up the Javascript message 'Are you sure you want to navigate away from this page?'

I can only confirm this happens in IE7. It doesn't happen in Chrome, Firefox, or Safari. I don't know if it happens in IE6 or IE8.

For anyone seeing this issue, there is an option to turn off the warning messages in the module settings.

Greg Varga’s picture

I can also confirm that this is still an issue in IE7; Module version 6.x-2.5; I will look into this today and post back if I found a solution.
Cheers, Gergely

edit: IE7 triggers the exit JS on submit button click. couldn't figure out why. incompatible code?

izmeez’s picture

Version: 6.x-1.0 » 6.x-2.5
Status: Closed (duplicate) » Active

subscribe

sureiwin’s picture

Confirm : IE7 triggers the exit JS on submit button click, and confirm this is on 2.6.

And this is my temp fix.

onUserExit.js file:

$("form").each(function() {
			var obj = $(this);
			currentonSubmit = obj.attr("onSubmit");
			if (currentonSubmit === undefined) {
				currentonSubmit = "";
			}
			obj.attr("onSubmit", currentonSubmit + " userMovingWithinSite();");
                     
                    // temp fix for IE7 triggers the exit JS on submit button click       
                     for(i=0; i<this.elements.length; i++)
                     {   
                         if(this.elements[i].type == "submit"){
                               var submitbutton = $(this.elements[i]);
                               submitbutton.bind("click", function(){
                                                            userMovingWithinSite();
                                                          });
                         }
                     }

		});
ohnobinki’s picture

Version: 6.x-2.5 » 6.x-2.7
Status: Active » Closed (duplicate)

I will consider this a duplicate of #1419142: on IE7 and IE8, Save Button displays "If you proceed all of your changes will be lost" message, but does Save properly. because it appears to be an IE-specific issue as in the that other bug. Please comment on the referenced bug to inform us if the 6.x-2.8/7.x-1.3 release of content_lock still has this bug.

Thanks.