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

I should be able to upload images or media files and use them in the description of the event

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide

      Note

      There is a bug with the atto editor auto save functionality in the event form (MDL-59686) where it’s continuing to restore draft areas even after the form is submitted.

      Test prerequisites

      1. Log in as admin
      2. Go to the calendar (Nav drawer > calendar)

      New event

      1. Click the “new event” button
      2. Add a title
      3. Click the “more” button in the modal footer
      4. Add an image to the description
        • Click the image button in the atto toolbar
        • Select browse repositories
        • Search for a cat pic in wikimedia
      5. Set the duration to “until” and set the date to some date in the past
      6. Click save
      7. Confirm that the modal reloads with a validation error
      8. Confirm that the image is still in the description
      9. Change the duration option to “without duration”
      10. Click save
      11. Confirm that the event is created
      12. View the event record in the event table in the database
      13. Confirm that the description has the @@PLUGINFILE@@ placeholder in it instead of a proper URL
      14. View the records in the files table in the database
      15. Confirm that you see the files in the draft area and in the calendar/event_description area (i.e. the files have been successfully “saved”)
      16. Delete the records from the editor_atto_autosave table (avoids the issue with MDL-59686)

      Edit event

      1. Click the event you just created to open the summary modal
      2. Confirm that the description shows the image in the modal
      3. Inspect the image in the page and confirm that the source URL is referencing pluginfile.php not draftfile.php
      4. Click the edit button
      5. Click the “more” button in the modal footer
      6. Confirm the image is displayed in the editor for description
      7. View the HTML for the description (click the HTML button under the advanced buttons in the editor}}
      8. Confirm the image source is referencing draftfile.php instead of pluginfile.php (when editing the event we should always be operating on a draft file, not the original)
      9. Modify the description how ever you like (delete the image, add text, add more images, etc)
      10. Save the changes
      11. Confirm the event updates correctly, check the description field for the record in the event table, check that new records are added to the files table if you added any more images.
      12. Delete the records from the editor_atto_autosave table (avoids the issue with MDL-59686)

      Event without file

      1. Create a new event
      2. Add some plain text (or HTML) in for the description
      3. Save the event
      4. Confirm that the event saves correctly
      5. Click the event to see the summary modal
      6. Confirm the description renders correctly in the modal
      7. Click “edit”
      8. Confirm that the description is populated correctly with the existing value
      9. Change the description and save the event
      10. Confirm that the event is correctly updated

      Backup and restore

      1. Create a course
      2. Enrol a user as a teacher in the course
      3. Log in as the teacher
      4. Go to the calendar
      5. Create a course event
        • Click "new event" and select "course" from the type
      6. Add an image to the event's description
      7. Save the event
      8. Backup the course and include the calendar events in the backup
      9. In a separate site (with the patch from this issue applied) restore the course backup
      10. Enrol a user as a teacher in the restored course
      11. Log in as that user
      12. Navigate to the calendar
      13. Click the course event to open the summary dialogue
      14. Confirm that the image is displayed for the description
      15. Edit the event
      16. Confirm that the image is displayed in the description editor
      Show
      Note There is a bug with the atto editor auto save functionality in the event form ( MDL-59686 ) where it’s continuing to restore draft areas even after the form is submitted. Test prerequisites Log in as admin Go to the calendar (Nav drawer > calendar) New event Click the “new event” button Add a title Click the “more” button in the modal footer Add an image to the description Click the image button in the atto toolbar Select browse repositories Search for a cat pic in wikimedia Set the duration to “until” and set the date to some date in the past Click save Confirm that the modal reloads with a validation error Confirm that the image is still in the description Change the duration option to “without duration” Click save Confirm that the event is created View the event record in the event table in the database Confirm that the description has the @@PLUGINFILE@@ placeholder in it instead of a proper URL View the records in the files table in the database Confirm that you see the files in the draft area and in the calendar/event_description area (i.e. the files have been successfully “saved”) Delete the records from the editor_atto_autosave table (avoids the issue with MDL-59686 ) Edit event Click the event you just created to open the summary modal Confirm that the description shows the image in the modal Inspect the image in the page and confirm that the source URL is referencing pluginfile.php not draftfile.php Click the edit button Click the “more” button in the modal footer Confirm the image is displayed in the editor for description View the HTML for the description (click the HTML button under the advanced buttons in the editor}} Confirm the image source is referencing draftfile.php instead of pluginfile.php (when editing the event we should always be operating on a draft file, not the original) Modify the description how ever you like (delete the image, add text, add more images, etc) Save the changes Confirm the event updates correctly, check the description field for the record in the event table, check that new records are added to the files table if you added any more images. Delete the records from the editor_atto_autosave table (avoids the issue with MDL-59686 ) Event without file Create a new event Add some plain text (or HTML) in for the description Save the event Confirm that the event saves correctly Click the event to see the summary modal Confirm the description renders correctly in the modal Click “edit” Confirm that the description is populated correctly with the existing value Change the description and save the event Confirm that the event is correctly updated Backup and restore Create a course Enrol a user as a teacher in the course Log in as the teacher Go to the calendar Create a course event Click "new event" and select "course" from the type Add an image to the event's description Save the event Backup the course and include the calendar events in the backup In a separate site (with the patch from this issue applied) restore the course backup Enrol a user as a teacher in the restored course Log in as that user Navigate to the calendar Click the course event to open the summary dialogue Confirm that the image is displayed for the description Edit the event Confirm that the image is displayed in the description editor
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-59919-master

      Description

      I should be able to upload images or media files and use them in the description of the event.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17