Hello,
I would like to request for the option to unlock the node form when the user navigates away from the page.
I believe this would be a great flexible feature to add to your module (also brings over this feature for the outdated checkbox module)
I am in real need of this feature and have read many other people requesting for this.
Please consider adding this feature to your awesome module!
I really appreciate all of your hard work.
Thank you very much in advance
Comments
Comment #1
eugenmayer commentedPleae have a look at http://drupal.org/node/714808#comment-2623902.
If you mean we need some JS-Based "are you sure you want to leave this page, if you do so the lock will be removed", well thats a possible feature.
Yet the user can save or press cancel to remove the lock.
Comment #2
Bilmar commentedHi Eugene,
I have read your post at #714808: Unsure about when the node gets locked and appreciate the detailed explanation of the goals of your module.
Yes, a JS-Based "Are you sure you want to leave this page? If you do so the lock will be removed" would be great! I definitely understand the flow process where you want the user to actively unlock the page by either a save or cancel, but this new feature would add another level of use-cases covering the user's flow from my experience dealing with people on my site and from my study of dozens of test users.
I really appreciate your quick reply and look forward to following your work.
Regards
Comment #3
eugenmayer commentedCorrecting the title.
So this feature request is about a js even handler which will show a dialog when the user wants to leave the current page.
Needs:
1. Ask user "Do you really want to leave? The content will not long be protected editting by others!
2. If the user selects yes, a ajax call will unlock the node. Here it will get tricky to hold back CSRF attacks (use the form token)
3. If the user selects no, nothing happens OR he can leave the site?
4. Possibility to turn dialog off in the admin menu
For point 3, iam actually even of not allowing to leave the site. We somehow have to educate the people in such enviroments, that editing is not just like "surfing" in the internet. As we dont want a ghost-lock, i for keeping the user (browser window) on the site until the user does not press ok, cancel, or (close/back + yes)
Comment #4
eugenmayer commentedScope: next release
Comment #5
YK85 commentedsubscribing
For (3) above it would make sense to just stay on the page if user chooses 'no'
The option to turn off this Dialog as mentioned in (4) would be great!
Therefore, if I use navigates away or closes the window then the node will automatically be unlocked (the use-case that I am really looking for).
Additional:
It would be cool if there can be an option to select Dialog for
a. Navigates away
b. Coses window
c. Both navigates away or closes window
This way we can have it setup so if the user closes the window then it will quietly auto-unlock the node form, but if the user tries to navigate away it will give them the dialog.
Thanks!
Comment #6
eugenmayer commentedGreat input!
Help implementing :)
Comment #7
YK85 commentedhehe, sorry for all my comments only being requests/ideas
i definitely want to but i dont know the first thing when it comes to programming =(
thank you!
Comment #8
eugenmayer commentedWell here we go, included in the new 1.0RC3 :) release
Comment #9
eugenmayer commentedComment #10
duozerskHi,
I might be a little late here, just read the release notes for the latest rc3 release and noted this feature - wouldn't it actually duplicate (and create compatibility issues with) the efforts of the modules:
Dirty Forms (http://drupal.org/project/dirtyforms) and onBeforeUnload API (http://drupal.org/project/onbeforeunload)
I have them installed and they are doing fine not only for the node edit form, but for all the forms you enable in the settings (Dirty Forms module). I believe it is the more general implementation and we should try to leverage it rather then compete.
Would appreciate your thoughts about this.
AndyB
Comment #11
eugenmayer commentedThey dont unlock the content lock, so i cant us them?
Comment #12
duozerskYes, they don't unlock the content.
The idea was that we don't recreate the functionality that is already developed (Dirty Forms - showing the message "are you sure you want to leave the page" when leaving the form that was modified, e.g. you changed smth in the fields) and is based on the onBeforeUnload API, but rather integrate with this implementation to do our stuff (content unlocking).
From what I see, we should be able to reuse the onBeforeUnload API JS implementation. Just register our JS function to be called (Drupal.onBeforeUnload.addCallback) - it has the example implementation showing the API usage. And it uses Drupal.behaviors which guarantees better compatibility.
Maybe we will also be able to somehow "see" what user answers in the Dirty Forms to do our content unlocking AJAX call...
Maybe I'm wrong in my assumptions... I'm not that proficient in JS to be completely sure that " AJAX content unlocking" feature can integrate with them.
AndyB
Comment #13
eugenmayer commentedWell actually '"onBeforeUnload" is not enaugh for content_unlock, as i need to be called "before" the other page gets loaded. I see a valid point in using the onbeforeunload "API", but hey, why use an API for an Event?
Its a -single- event a register on with a one-liner and then add my code. Cant see why i need a module for that (and a new dependencie). Iam just not a friend of overcomplicating things by stuffing an API arround and API (without a special gain..).
Anyway thanks for the inpute!
Comment #14
eugenmayer commented