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

Event for description restores draft even after modal closed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.2.6, 3.3.3
    • 3.4
    • Calendar
    • MOODLE_34_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MDL-59686-master
    • Hide
      MASTER
      1. Log in as admin and go to Calendar.
      2. Click New event button.
      3. On the form, add a title, click Show more and add an image as description.
      4. Save and click New event button again.
      5. Click Show more and make sure the field is empty and the content of previous event was not restored.
      6. Go to Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings
      7. Change editor_atto | autosavefrequency setting to 5 seconds.
      8. Go back to Calendar, click New event button, click Show more and add something to description field (wait 5 seconds)
      9. Make sure it does not save the draft after that period.
      10. Add the event and click to add another one.
      11. Make sure it does not restore the draft from your previous event.
      3.3 AND 3.2
      1. Log in as admin.
      2. Go to Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings
      3. Change editor_atto | autosavefrequency setting to 5 seconds.
      4. Open calendar/lib.php and search for $editoroptions array (line 180 on 3.3 and line 1975 on 3.2) and add another item to array 'autosave' => false

            protected $editoroptions = array(
                'subdirs' => false,
                'forcehttps' => false,
                'maxfiles' => -1,
                'maxbytes' => null,
                'trusttext' => false,
                'autosave' => false
            );
        

      5. Now on the calendar UI, click New event button and type something on the description field.
      6. Make sure it does not save the draft after 5 seconds.
      7. You can revert the commit of those branchs and notice the draft will be saved even if you add 'autosave' => false to the array.
      Show
      MASTER Log in as admin and go to Calendar. Click New event button. On the form, add a title, click Show more and add an image as description. Save and click  New event button again. Click Show more and make sure the field is empty and the content of previous event was not restored. Go to Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings Change editor_atto | autosavefrequency setting to 5 seconds. Go back to Calendar, click New event button, click Show more and add something to description field (wait 5 seconds) Make sure it does not save the draft after that period. Add the event and click to add another one. Make sure it does not restore the draft from your previous event. 3.3 AND 3.2 Log in as admin. Go to Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings Change editor_atto | autosavefrequency setting to 5 seconds. Open calendar/lib.php and search for $editoroptions array (line 180 on 3.3 and line 1975 on 3.2) and add another item to array 'autosave' => false protected $editoroptions = array( 'subdirs' => false, 'forcehttps' => false, 'maxfiles' => -1, 'maxbytes' => null, 'trusttext' => false, 'autosave' => false ); Now on the calendar UI, click New event button and type something on the description field. Make sure it does not save the draft after 5 seconds. You can revert the commit of those branchs and notice the draft will be saved even if you add 'autosave' => false to the array.

      After the changes in MDL-59382 to put the event form in a modal the description the draft are restoring doesn't work correctly. It should clear after the modal is closed or successfully saved but instead it restores old drafts.

      This is made worse because the description field isn't visible by default in the modal until you click the "more" button.

            lameze Simey Lameze
            ryanwyllie Ryan Wyllie
            Mihail Geshoski Mihail Geshoski
            Jake Dallimore Jake Dallimore
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.