Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If instead of clicking Save, the user clicks Preview, and then navigates away from that, the work is (potentially) lost.
Steps:
1. Log in
2. Add content
3. Choose a content type, e.g., Basic Page
4. Type in all required fields
5. Click Preview
6. Click Home button
Actual results: Navigates away from page without warning.
Expected results: Gives navigation warning. That is, preview is assumed dirty.
(In this instance, I was able to use the back button and retained my work, but had step 6 been Click Log out, the work would have been lost.)
Comments
Comment #1
Charles BelovComment #2
Charles BelovI added the following lines to add preview protection:
before
if ((edit) && !click) {
If I have a chance, I'll submit it as a patch.
Comment #3
Mohammed J. RazemClosing this as outdated as this version will no longer be supported/maintained.