Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47140

Atto autosave: overwrites your content if an error occurs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8
    • Component/s: HTML Editor (Atto)
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a user whose preferred text editor is "Atto HTML editor".
      2. Create a forum that the newly created user will have permission to post/reply in.
      3. With the newly created user, go to reply to a post or create a new post. Enter some text into the "Message" text field. Wait at least 60 seconds and close the tab or log out.
      4. Verify that the message was autosaved into the mdl_editor_atto_autosave table

        select * from mdl_editor_atto_autosave

      5. Change the mdl_editor_atto_autosave table to a different name.

        ALTER TABLE mdl_editor_atto_autosave RENAME TO mdl_dave

      6. Go back to the form that you typed the message in (i.e. the form where the draft was saved). Observe that there is no database error being dumped into that text area. Also observe that a notification informing the user that there was an error retrieving their draft is displayed.
      7. Check the javascript console to see the debug output (in this case, a 'table not found' error should be displayed).
      Show
      Create a user whose preferred text editor is "Atto HTML editor". Create a forum that the newly created user will have permission to post/reply in. With the newly created user, go to reply to a post or create a new post. Enter some text into the "Message" text field. Wait at least 60 seconds and close the tab or log out. Verify that the message was autosaved into the mdl_editor_atto_autosave table select * from mdl_editor_atto_autosave Change the mdl_editor_atto_autosave table to a different name. ALTER TABLE mdl_editor_atto_autosave RENAME TO mdl_dave Go back to the form that you typed the message in (i.e. the form where the draft was saved). Observe that there is no database error being dumped into that text area. Also observe that a notification informing the user that there was an error retrieving their draft is displayed. Check the javascript console to see the debug output (in this case, a 'table not found' error should be displayed).
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47140-master

      Description

      One easy if crude way to make an error is to temporarily rename the editor_atto_autosave table to something else.

      If you do this (or if you forget to go to the admin Notifications page after pulling the latest weekly from git, which was my mistake) then when you go to a form, the contents of all the Atto editors gets replaced by a JSON-encoded error message, overwriting your data.

      The system needs to me more error-tolerant than this.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14