Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.4
-
Fix Version/s: 1.9.5
-
Component/s: Administration, Assignment, Backup, Course, General, Lesson, Resource
-
Labels:None
-
Difficulty:Moderate
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
I'm using a moodle instalation 1.9.4. from 3 weeks ago. I'm having the
following problem:
When restoring a course into a new course, the image and resource links
are broken. Looking the links I can see that it's calling the old course
id, not the new one. For example:
a course with id= 35 have the image links like:
http://avirtual.forempv.ccoo.es/file.php?file=%2F32%2Fimage.jpg, where 32
is the id of the old course from wich I did the backup.
I saw several posts with more or less the same problem, but I could'nt see
any clear solution or could'nt see any explanation that there isn´t a
solution now to this problem. I could'nt find this on the tracker.
I would be glad to know if there is any solution to this, because i and
I'm having to change by hand the id number of all the images and resources.
Thank's in advance
Hi Daniel,
thanks a lot for sharing your backup example!
I've been analysing it and I've found that it includes links like this:
http://yourserver/file.php?file=%2F260%2Fimage.jpg
And, IMO, that's the cause of your problem, those %2F encoded chars that should be normal and simple slashes.
The key is that backup uses to transform any link of the form:
http://yourserver/file.php?file=/COURSEID to something called $@FILEPHP@$ and later, restore is able to transform back all those $@FILEPHP@$ to the new URL with the new courseid.
In your case, those %2F are breaking the transformation on backup, hence restore hasn't anything to transform back, so your original URLs are left unmodified.
While I think (good news) this is easy to fix (in backup process, by looking also to all those %2F chars... I'm very interested about to KNOW how those horrible encoded chars have ended there. Can you, please, explain how have you added those images?
As said, I think we can modify (and will do) the backup procedure to be able to detect those chars easily but we should prevent them to be there at origin.
ANy info will be welcome, TIA! Ciao
- Copying them from the file manager?
- Using the HTML Editor? The "official" one or any alternative?
- Using plain text editor and typing the HTML by hand?
- ....
As said, I think we can modify (and will do) the backup procedure to be able to detect those chars easily but we should prevent them to be there at origin. ANy info will be welcome, TIA! Ciao