Moodle

ID numbers included in image pathing is explicit

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.5
  • Component/s: Backup, HTML Editor
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When including an image in an HTML entry for a course, after choosing the image through the file picker the image is pathed through file.php and then the id number in the path as well. For example: http://172.16.0.11/moodle-dev/file.php/4/Barista_course_header_moodle_grey.jpg

When this course is backed up and restored as a new course, the id number encoded above (4 in this case) remains static. The image link is broken.

Martin has indicated that this shouldn't happen and is a bug.

I think this gets more interesting though, as if the image exists in that course id, even though the new course has a new id (so in other words the new course has been restored into the same Moodle environment) then the image will work as it can access it from the original course. This changes however if the environments are different and courseid 4 does not contain the image required. Also, I'm not sure if access/enrollment is needed to the other course for the cross-course inclusion to occur - the image may fail if you don't have access to that course.

This Moodle forum topic explains the issue: http://moodle.org/mod/forum/discuss.php?d=116190

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Resolving as fixed.

The replace of course->summary was happening too early in the restore process (before knowing course record id). Moved to restore_decode_content_links(), near the end, fixes the problem.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Resolving as fixed. The replace of course->summary was happening too early in the restore process (before knowing course record id). Moved to restore_decode_content_links(), near the end, fixes the problem. Ciao

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: