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

Encode pluginfile.php urls in backup

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    •  MDL-75623-MOODLE_401_STABLE
    •  MDL-75623-master
    • Easy
    • Hide
      1. Create a course
      2. Create a label in the course and insert an image using the text editor in this label.
      3. View the label and copy the address of the image.
      4. Create anoter label and insert this plain HTML:
        <img src="{address from step 3}">
      5. Backup the whole course and restore it as a new course.
      6. Compare the two images in the restored course - they should have the same URL.
      Show
      Create a course Create a label in the course and insert an image using the text editor in this label. View the label and copy the address of the image. Create anoter label and insert this plain HTML: <img src="{address from step 3}"> Backup the whole course and restore it as a new course. Compare the two images in the restored course - they should have the same URL.

    Description

      When uploading an image (or a file of another type) in an activity (e.g. mod_label), the file is accessible via https://.../pluginfile.php/\{contextid}/{pluginname}/...

      To reuse this file (especially images) most trainers copy this URL and then use this URL in other places (e.g. the intro of another activity).

      If you want to reuse the course and do a course backup, these URLs (with pluginfile.php) don't get encoded like other URLs (e.g. with view.php or sth. similar) and still point at the old target.

      pluginfile URLs should also be encoded for backup when linking to the files of another activity. It should be possible to replace the values of the context id after the course restore is done (as plugins can do in restore_..._task::after_restore() 

       

      Attachments

        Activity

          People

            stefan.hanauska Stefan Hanauska
            stefan.hanauska Stefan Hanauska
            Shamim Rezaie Shamim Rezaie
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            14 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 24 minutes
                1h 24m

                Clockify

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