Moodle
  1. Moodle
  2. MDL-17243

Accidental browser navigation loses changes when editing wiki

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.3, 2.0
    • Fix Version/s: None
    • Component/s: Wiki (2.x)
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      4820

      Description

      Open up a wiki page
      Click on 'edit'
      Start making some changes
      Browse to another page (can easily happen if your browser is set to open external links in same window)

      WHAT HAPPENS
      The changes you made are now lost (some browsers will retrieve them if you press back, but not all browsers support this).

      WHAT WAS EXPECTED
      A warning dialog (with OK/Cancel buttons), to prevent accidental loss of edits

      Suggestion: use 'window.onbeforeunload' to pop up a message and add 'onclick="window.onbeforeunload = null;"' to each of the 'save', 'cancel' and 'preview' buttons.

        Activity

        Hide
        Davo Smith added a comment -

        This still seems to be an issue with Moodle 2.0 - is there likely to be any progress on this?

        This issue is preventing me from using Wikis to help students take notes, as many of them have lost work due to this missing feature.

        Show
        Davo Smith added a comment - This still seems to be an issue with Moodle 2.0 - is there likely to be any progress on this? This issue is preventing me from using Wikis to help students take notes, as many of them have lost work due to this missing feature.
        Hide
        Ludo ( Marc Alier) added a comment -

        Yep. The only solution is to prevent any going out of the page if is not via Submit or cancel Buttons. This can easily done, but only browsers with javascript enabled will benefit.
        If is ok, we can proceed to it.

        Show
        Ludo ( Marc Alier) added a comment - Yep. The only solution is to prevent any going out of the page if is not via Submit or cancel Buttons. This can easily done, but only browsers with javascript enabled will benefit. If is ok, we can proceed to it.
        Hide
        Davo Smith added a comment -

        I know that a javascript-only solution is less than ideal, however it would still be a lot better than no solution at all - the lack of javascript would mean the loss of an extra, helpful safeguard, rather than the breaking of a major feature (which would fit with the progressive-enhancement ideology).

        Is it possible to detect changes in the html editor and trigger a warning on page exit only if something has been typed there?
        The alternative of offering a warning box any time they leave via any method other than 'Save' or 'Cancel', is acceptable (we did a local hack like that involving just a couple of lines of javascript in college - although that got misplaced during an upgrade).

        Show
        Davo Smith added a comment - I know that a javascript-only solution is less than ideal, however it would still be a lot better than no solution at all - the lack of javascript would mean the loss of an extra, helpful safeguard, rather than the breaking of a major feature (which would fit with the progressive-enhancement ideology). Is it possible to detect changes in the html editor and trigger a warning on page exit only if something has been typed there? The alternative of offering a warning box any time they leave via any method other than 'Save' or 'Cancel', is acceptable (we did a local hack like that involving just a couple of lines of javascript in college - although that got misplaced during an upgrade).
        Hide
        Marina Glancy added a comment -

        Thanks for reporting this.

        I'm closing this issue because I believe it affects only unsupported versions of Moodle. This issue will remain here in case other users have the same problem.

        If you haven't already done so, I encourage you to upgrade to a supported version.

        Show
        Marina Glancy added a comment - Thanks for reporting this. I'm closing this issue because I believe it affects only unsupported versions of Moodle. This issue will remain here in case other users have the same problem. If you haven't already done so, I encourage you to upgrade to a supported version.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: