Moodle

Missing image links when restoring courses in Moodle 1.8

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Won't Fix
  • Affects Version/s: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2
  • Fix Version/s: None
  • Component/s: Backup
  • Labels:
    None
  • Affected Branches:
    MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE

Description

I believe that this has been an big issue since Moodle 1.5.x and so far even the latest version of 1.8.2+ still have not fixed this. If you backup a course and restore it on another server, all the text and content would restore correctly, BUT image links are broken due to moodle require absolute links rather than relative. This bug should be fixed ASAP IMHO. Thanks!

  1. restore_missing_image_links.png
    184 kB
    17/Aug/07 2:32 AM

Issue Links

Activity

Hide
Wen Hao Chuang added a comment -
Show
Wen Hao Chuang added a comment - Also see discussion http://moodle.org/mod/forum/discuss.php?d=73462
Hide
Wen Hao Chuang added a comment -

the logo/banner is missing after restore to another server

Show
Wen Hao Chuang added a comment - the logo/banner is missing after restore to another server
Hide
Petr Škoda (skodak) added a comment -

Hi!

Only absolute links are supported in html content. Relative links may work only inside the uploaded files area.

I am not sure I understand the description. Do absolute links in backup/restore work for you?

skodak

Show
Petr Škoda (skodak) added a comment - Hi! Only absolute links are supported in html content. Relative links may work only inside the uploaded files area. I am not sure I understand the description. Do absolute links in backup/restore work for you? skodak
Hide
Bryce Thornton added a comment -

I have found this to be true in certain situations. I wrote a script that called "import_backup_file_silently" that worked perfectly except that the image links were broken. I traced it down to the function "restore_decode_absolute_links". This function assumes that there is a variable called $restore in the global scope. "import_backup_file_silently" sets all the variables in $SESSION->restore, not $restore. So, when "restore_decode_absolute_links" tries to look at the global $restore it is null. To fix this I add the following to "import_backup_file_silently":

global $restore;
$restore = $SESSION->restore;

if (!restore_execute($SESSION->restore,$SESSION->info,$SESSION->course_header,$errorstr)) {

There may be other situations where $restore is not set when "restore_decode_absolute_links" is called.

Show
Bryce Thornton added a comment - I have found this to be true in certain situations. I wrote a script that called "import_backup_file_silently" that worked perfectly except that the image links were broken. I traced it down to the function "restore_decode_absolute_links". This function assumes that there is a variable called $restore in the global scope. "import_backup_file_silently" sets all the variables in $SESSION->restore, not $restore. So, when "restore_decode_absolute_links" tries to look at the global $restore it is null. To fix this I add the following to "import_backup_file_silently": global $restore; $restore = $SESSION->restore; if (!restore_execute($SESSION->restore,$SESSION->info,$SESSION->course_header,$errorstr)) { There may be other situations where $restore is not set when "restore_decode_absolute_links" is called.
Hide
Wen Hao Chuang added a comment -
Show
Wen Hao Chuang added a comment - also see http://tracker.moodle.org/browse/MDL-8132
Hide
Thomas Caswell added a comment - - edited

I have seen the same issue for several versions of Moodle now. I create a glossary containing terms with images inserted with the definition. Then I make a backup of the course, upload the backup to a different Moodle site, perform a restore, and all of the embeded images continue to have the old site's domain name as part of the image's absolute URL. This of course, breaks the image and prevents it from displaying on the new site. This is particularly troubling since all of the images are imported correctly. It appears that the backup/restore method need to be able to adjust the domain name for the absolute URL based on the config file.

Of course the problem exists throughout Moodle, wherever an image is inserted (e.g., quizzes, etc.).

Show
Thomas Caswell added a comment - - edited I have seen the same issue for several versions of Moodle now. I create a glossary containing terms with images inserted with the definition. Then I make a backup of the course, upload the backup to a different Moodle site, perform a restore, and all of the embeded images continue to have the old site's domain name as part of the image's absolute URL. This of course, breaks the image and prevents it from displaying on the new site. This is particularly troubling since all of the images are imported correctly. It appears that the backup/restore method need to be able to adjust the domain name for the absolute URL based on the config file. Of course the problem exists throughout Moodle, wherever an image is inserted (e.g., quizzes, etc.).
Hide
Wen Hao Chuang added a comment -

Added Martin to the watch list, thanks Martin!

Show
Wen Hao Chuang added a comment - Added Martin to the watch list, thanks Martin!
Hide
Martin Dougiamas added a comment -

Can someone post some actual sample links that are breaking (so it can be analysed)?

There's a lot of different circumstances here, it's not a straightforward problem. Messing with URLs may fix some sites and break others.

Absolute URLs are the way to go in Moodle - they should be working. If they are NOT working for some version/module of Moodle then it's a bug (possibly just with that module).

Show
Martin Dougiamas added a comment - Can someone post some actual sample links that are breaking (so it can be analysed)? There's a lot of different circumstances here, it's not a straightforward problem. Messing with URLs may fix some sites and break others. Absolute URLs are the way to go in Moodle - they should be working. If they are NOT working for some version/module of Moodle then it's a bug (possibly just with that module).
Hide
I. Thomas added a comment -

Hi all,

Here is what happens to me.

The backup file moodle.xml uses the path from the old course. It works fine if I restore it to the same server but if I want to install it to a different server the images break.

My work around is to go into the moodle.xml file and do a global replace of "http://yourserver.ca/moodledata/8/yourimage.jpg" with "http://$@FILEPHP@$/yourimage.jpg"

I will post an example when I am back at work next week.

I.

Show
I. Thomas added a comment - Hi all, Here is what happens to me. The backup file moodle.xml uses the path from the old course. It works fine if I restore it to the same server but if I want to install it to a different server the images break. My work around is to go into the moodle.xml file and do a global replace of "http://yourserver.ca/moodledata/8/yourimage.jpg" with "http://$@FILEPHP@$/yourimage.jpg" I will post an example when I am back at work next week. I.
Hide
Wen Hao Chuang added a comment -

Hi Thomas, which version of moodle did you use? Thanks!

Show
Wen Hao Chuang added a comment - Hi Thomas, which version of moodle did you use? Thanks!
Hide
Wen Hao Chuang added a comment -

I did some more testing about this issue, here is what I have found so far:

1. The only thing that I could constantly reproduce is the "Edit Profile" -> Picture. I took a look at the moodle.xml file and all the folders (user_files, moddata, group_files, course_files) in a typical moodle backup .zip file. The picture file (in the profile) is NOT being backed up for now (since moodle 1.5 to 1.9).

2. For other modules it seems as long as the moodle.xml file saved the URL of the image file as @FILEPHP@$/yourimage.jpg then it would be OK. I couldn't find out "when" the URL will NOT be saved this way, although as reported (and we encountered this before), in some special cases the URL is NOT saved this way (and will include the actual site URL, such as "http://youroriginalserver/moodledata/yourimage.jpg"

=> We need to find out what cases would actually generate this type of URLs in the moodle.xml file

Any thought or comments? Thanks!

Show
Wen Hao Chuang added a comment - I did some more testing about this issue, here is what I have found so far: 1. The only thing that I could constantly reproduce is the "Edit Profile" -> Picture. I took a look at the moodle.xml file and all the folders (user_files, moddata, group_files, course_files) in a typical moodle backup .zip file. The picture file (in the profile) is NOT being backed up for now (since moodle 1.5 to 1.9). 2. For other modules it seems as long as the moodle.xml file saved the URL of the image file as @FILEPHP@$/yourimage.jpg then it would be OK. I couldn't find out "when" the URL will NOT be saved this way, although as reported (and we encountered this before), in some special cases the URL is NOT saved this way (and will include the actual site URL, such as "http://youroriginalserver/moodledata/yourimage.jpg" => We need to find out what cases would actually generate this type of URLs in the moodle.xml file Any thought or comments? Thanks!
Hide
Petr Škoda (skodak) added a comment -

Is is a terrible server misconfiguration to have /moodledate/ directly accessible, there must not be any links like this, they must not work in any case

The profile pictures should be restoring fine at least in 1.9dev, I did some patching there about 3 weeks ago, could somebody please confirm it?

If there is no new info I will close this bug. Please file more specific bugs for individual modules with included sample backups. I believe the relinking works fine in general, the problems are caused mostly by urls in unexpected form.

Petr

Show
Petr Škoda (skodak) added a comment - Is is a terrible server misconfiguration to have /moodledate/ directly accessible, there must not be any links like this, they must not work in any case The profile pictures should be restoring fine at least in 1.9dev, I did some patching there about 3 weeks ago, could somebody please confirm it? If there is no new info I will close this bug. Please file more specific bugs for individual modules with included sample backups. I believe the relinking works fine in general, the problems are caused mostly by urls in unexpected form. Petr
Hide
Wen Hao Chuang added a comment -

Hi Petr, do you have the moodle bug tracker ticket number for the patching that you did about 3 weeks ago? Also did this patch get back ported into 1.8, 1.7, and 1.6? Thanks!

Show
Wen Hao Chuang added a comment - Hi Petr, do you have the moodle bug tracker ticket number for the patching that you did about 3 weeks ago? Also did this patch get back ported into 1.8, 1.7, and 1.6? Thanks!
Hide
Petr Škoda (skodak) added a comment -

I suppose you could find it easily in cvs history for backup/restorelib.php ... hmmm.... here it is MDL-8605

Show
Petr Škoda (skodak) added a comment - I suppose you could find it easily in cvs history for backup/restorelib.php ... hmmm.... here it is MDL-8605
Hide
Rob Faulkner added a comment -

This is also vastly prohibitive if for whatever reason one decides to change the fqdn of their server, and consequently change $CFG->wwwroot in config.php. Could the changing of the server domain name be handled within the administration block, along with some form of database regex replace of old name with the new?

Show
Rob Faulkner added a comment - This is also vastly prohibitive if for whatever reason one decides to change the fqdn of their server, and consequently change $CFG->wwwroot in config.php. Could the changing of the server domain name be handled within the administration block, along with some form of database regex replace of old name with the new?
Hide
Mark Pearson added a comment -

I agree with Rob. Every academic year we start afresh with a new Moodle version and fresh database (new wine; new wineskins ...). We make last year's installation available at moodle.earlham.edu/0607 for example. But since all the image links are hardcoded absolute paths they all break and faculty are understandably perturbed. I also have to remember to restore from backups made before the switch so that the image links will be retained.

Show
Mark Pearson added a comment - I agree with Rob. Every academic year we start afresh with a new Moodle version and fresh database (new wine; new wineskins ...). We make last year's installation available at moodle.earlham.edu/0607 for example. But since all the image links are hardcoded absolute paths they all break and faculty are understandably perturbed. I also have to remember to restore from backups made before the switch so that the image links will be retained.
Hide
Rob Faulkner added a comment - - edited

Depending on where this problem manifests itself (in my case, labels and resources), my bodge of a solution was:

update mdl_resource set alltext = replace(alltext,'old-address','new-address');

update mdl_label set name = replace(name,'old-address','new-address');

update mdl_label set content = replace(content,'old-address','new-address');

(I believe this is MySQL syntax only)

This works with substrings too, however labels didn't seem to be changing immediately. If I went to update the label, however, the changed version appeared. Is there any programatic caching that might be getting in the way of this change taking affect immediately?

Rob.

Show
Rob Faulkner added a comment - - edited Depending on where this problem manifests itself (in my case, labels and resources), my bodge of a solution was: update mdl_resource set alltext = replace(alltext,'old-address','new-address'); update mdl_label set name = replace(name,'old-address','new-address'); update mdl_label set content = replace(content,'old-address','new-address'); (I believe this is MySQL syntax only) This works with substrings too, however labels didn't seem to be changing immediately. If I went to update the label, however, the changed version appeared. Is there any programatic caching that might be getting in the way of this change taking affect immediately? Rob.
Hide
Wen Hao Chuang added a comment - - edited

I agree with Rob and Mark. As far as I know many universities who upgraded their moodle with fresh installation and fresh DB all experienced this problem.

Show
Wen Hao Chuang added a comment - - edited I agree with Rob and Mark. As far as I know many universities who upgraded their moodle with fresh installation and fresh DB all experienced this problem.
Hide
Mark Pearson added a comment - - edited

Given that Martin says "Absolute URLs are the way to go in Moodle" and I Thomas' workaround:

>My work around is to go into the moodle.xml file and do a global replace of "http://yourserver.ca/moodledata/8/yourimage.jpg" with "http://$@FILEPHP@$/yourimage.jpg"

Could there not be a patch in the Backup procedure that converts all URLs addressed with the WWWroot into the form 'http://$@FILEPHP@$' as suggested by IThomas? That way all URLs pointing to images in the moodle.xml would be transportable.

Show
Mark Pearson added a comment - - edited Given that Martin says "Absolute URLs are the way to go in Moodle" and I Thomas' workaround: >My work around is to go into the moodle.xml file and do a global replace of "http://yourserver.ca/moodledata/8/yourimage.jpg" with "http://$@FILEPHP@$/yourimage.jpg" Could there not be a patch in the Backup procedure that converts all URLs addressed with the WWWroot into the form 'http://$@FILEPHP@$' as suggested by IThomas? That way all URLs pointing to images in the moodle.xml would be transportable.
Hide
Wen Hao Chuang added a comment -

Mark I agree with you, any new update on this one? Thanks!

Show
Wen Hao Chuang added a comment - Mark I agree with you, any new update on this one? Thanks!
Hide
Petr Škoda (skodak) added a comment -

Hi,
could everybody please describe exact steps to reproduce his/her backup/restore relinking problem?
I need following info:
1/ where exactly is the image located - it MUST be in the same course as the link itself
2/ where exactly is the link located - db table+field is the most accurate, but page and form location is ok too
3/ which moodle version - exact date of the last checkout/download
4/ attach small sample backup file

This bug is not about changing of www address - you can not do a raw search replace in moodle.xml because it would break serialized strings. Only absolute urls are supported, it is not possible to change url on the fly in config.php

thanks

Show
Petr Škoda (skodak) added a comment - Hi, could everybody please describe exact steps to reproduce his/her backup/restore relinking problem? I need following info: 1/ where exactly is the image located - it MUST be in the same course as the link itself 2/ where exactly is the link located - db table+field is the most accurate, but page and form location is ok too 3/ which moodle version - exact date of the last checkout/download 4/ attach small sample backup file This bug is not about changing of www address - you can not do a raw search replace in moodle.xml because it would break serialized strings. Only absolute urls are supported, it is not possible to change url on the fly in config.php thanks
Hide
Wen Hao Chuang added a comment -

Hi Petr, here are steps to repo:

1. Backup a test case course (in this example, I backuped from ilearn2.sfsu.edu), and in this course I chose a picture for the user account "teacher teacher" and updated the picture in this particular profile..
2. Then restore this course (see attached .zip flle) to another server, say, moodletest.sfsu.edu Leave everything as default
3. After restore, click into the participant link, then you will notice that the "teacher teacher" 's picture in the profile is not showing correctly.

Hope this helps.

Show
Wen Hao Chuang added a comment - Hi Petr, here are steps to repo: 1. Backup a test case course (in this example, I backuped from ilearn2.sfsu.edu), and in this course I chose a picture for the user account "teacher teacher" and updated the picture in this particular profile.. 2. Then restore this course (see attached .zip flle) to another server, say, moodletest.sfsu.edu Leave everything as default 3. After restore, click into the participant link, then you will notice that the "teacher teacher" 's picture in the profile is not showing correctly. Hope this helps.
Hide
Petr Škoda (skodak) added a comment -

Oh, user pictures are something completely different. I remember fixing some problems there recently - please test again and always note exact version number in each report problem.
thanks

Show
Petr Škoda (skodak) added a comment - Oh, user pictures are something completely different. I remember fixing some problems there recently - please test again and always note exact version number in each report problem. thanks
Hide
Martin Dougiamas added a comment -

Wen, can you please clarify... Are you saying the original problem that started this issue (eg screenshot above) is no longer a problem for you? What changed?

Show
Martin Dougiamas added a comment - Wen, can you please clarify... Are you saying the original problem that started this issue (eg screenshot above) is no longer a problem for you? What changed?
Hide
Wen Hao Chuang added a comment -

Sorry, really busy preparing our faculty for spring 08 semester here.. sorry for the late response...

I have attached another backup course (I "borrowed" it from the moodle course exchange area) which people could try to restore it on the latest moodle 1.8.x codes, and you will see the first "summary" (which was made with a ...... PRIVACY ....... and a hyperlink) would not work after restore the course. I don't know how this course was backed up but I remember this was one of the problems that we encountered before. I'm still trying to compile a list of all related backup/restore image/hyperlink issues and steps to reproduce, will post it there later.

Show
Wen Hao Chuang added a comment - Sorry, really busy preparing our faculty for spring 08 semester here.. sorry for the late response... I have attached another backup course (I "borrowed" it from the moodle course exchange area) which people could try to restore it on the latest moodle 1.8.x codes, and you will see the first "summary" (which was made with a ...... PRIVACY ....... and a hyperlink) would not work after restore the course. I don't know how this course was backed up but I remember this was one of the problems that we encountered before. I'm still trying to compile a list of all related backup/restore image/hyperlink issues and steps to reproduce, will post it there later.
Hide
Wen Hao Chuang added a comment -

the 2nd backup file for testing (see summary area at the top - won't restore correctly)

Show
Wen Hao Chuang added a comment - the 2nd backup file for testing (see summary area at the top - won't restore correctly)
Hide
Martin Dougiamas added a comment -

I restored backup-mt2_alg_1-20040523-1320.zip in 1.8.4 and I can see the link in the first summary is:

<a href="$@RESOURCEVIEWBYID*4092@$">blah</a>

Obviously someone made a link like this:

<a href="http://originalsite/mod/resource/view.php?id=4092">blah</a>

which was converted during backup to the standard code.

Firstly, this is not a great way to specify some content as those URLs return all kinds of stuff (not raw images) so it may not have even worked originally. Better to use the URL containing file.php to specify the file directly (which is what the image browser in the HTML editor would have done).

Secondly, in looking at the backup/restore libraries for the resource module I think it WOULD have restored the resource correctly IF the resource had actually been within the course. So it looks to me like the resource was in a different course anyway, or had been deleted prior to making the backup.

All in all, I don't think we can solve this in code. Bad links are bad links.

Show
Martin Dougiamas added a comment - I restored backup-mt2_alg_1-20040523-1320.zip in 1.8.4 and I can see the link in the first summary is: <a href="$@RESOURCEVIEWBYID*4092@$">blah</a> Obviously someone made a link like this: <a href="http://originalsite/mod/resource/view.php?id=4092">blah</a> which was converted during backup to the standard code. Firstly, this is not a great way to specify some content as those URLs return all kinds of stuff (not raw images) so it may not have even worked originally. Better to use the URL containing file.php to specify the file directly (which is what the image browser in the HTML editor would have done). Secondly, in looking at the backup/restore libraries for the resource module I think it WOULD have restored the resource correctly IF the resource had actually been within the course. So it looks to me like the resource was in a different course anyway, or had been deleted prior to making the backup. All in all, I don't think we can solve this in code. Bad links are bad links.
Hide
Donna Hrynkiw added a comment -

We are also experiencing this problem.
We're running Moodle v1.8.3
All image links are broken when course backup file is moved to a separate instance of Moodle. Don't know yet if it's happening to all courses or just the two (belonging to single instructor) I happened to restored today.

Petr needs following info:
1/ where exactly is the image located - it MUST be in the same course as the link itself
They are.

2/ where exactly is the link located - db table+field is the most accurate, but page and form location is ok too
I don't quite understand what you're asking for here. The image links are in the topic summary block.
When I look at the HTML code, the links are absolute – to the originating instance.

3/ which moodle version - exact date of the last checkout/download
v1.8.3

4/ attach small sample backup file
Awaiting permission of instructor to share her backup file with you.

Donna Hrynkiw
Kwantlen University College

Show
Donna Hrynkiw added a comment - We are also experiencing this problem. We're running Moodle v1.8.3 All image links are broken when course backup file is moved to a separate instance of Moodle. Don't know yet if it's happening to all courses or just the two (belonging to single instructor) I happened to restored today. Petr needs following info: 1/ where exactly is the image located - it MUST be in the same course as the link itself They are. 2/ where exactly is the link located - db table+field is the most accurate, but page and form location is ok too I don't quite understand what you're asking for here. The image links are in the topic summary block. When I look at the HTML code, the links are absolute – to the originating instance. 3/ which moodle version - exact date of the last checkout/download v1.8.3 4/ attach small sample backup file Awaiting permission of instructor to share her backup file with you. Donna Hrynkiw Kwantlen University College
Hide
Barbara Braun added a comment -

Hi -

We're running Moodle v 1.8.3
The images are in the course.

Some news:

When I tried to restore the entire backup with several lessons - things exactly happened the way you describe it.
Now: same course, one lesson backuped - everything is fine - the course id is changed and images of the new course are displayed.
I had a workaround and changed all the ids in the xml-file but this is certainly what is supposed to be done by Moodle itself in the restoring process.

Unfortunately I won't get around to make a sample file today - but it might an important hint.
Greetings
Barbara

Show
Barbara Braun added a comment - Hi - We're running Moodle v 1.8.3 The images are in the course. Some news: When I tried to restore the entire backup with several lessons - things exactly happened the way you describe it. Now: same course, one lesson backuped - everything is fine - the course id is changed and images of the new course are displayed. I had a workaround and changed all the ids in the xml-file but this is certainly what is supposed to be done by Moodle itself in the restoring process. Unfortunately I won't get around to make a sample file today - but it might an important hint. Greetings Barbara
Hide
Vicki Dunnam added a comment -

Has anyone been able to resolve this issue of broken links to images?

Show
Vicki Dunnam added a comment - Has anyone been able to resolve this issue of broken links to images?
Hide
Bryce Thornton added a comment -

I have had this issue sporadically recently as well. Here is a chunk of data from the XML file:

<td bgcolor="#ffffff">
<p align="center"><img title="1212" src="/file.php/4/theater_masks_rocking_back_and_forth_md_clr.gif" border="0" alt="1212" width="130" height="130" /></p>
</td>

You can see the "/file.php/4/" image source. These were not replaced with the proper id.

Here is the top of the XML where a lot of the critical values are set:

<?xml version="1.0" encoding="UTF-8"?>
<MOODLE_BACKUP>
<INFO>
<NAME>backup-lit-20080820-0301.zip</NAME>
<MOODLE_VERSION>2007101521</MOODLE_VERSION>
<MOODLE_RELEASE>1.9.2+ (Build: 20080806)</MOODLE_RELEASE>
<BACKUP_VERSION>2008030300</BACKUP_VERSION>
<BACKUP_RELEASE>1.9</BACKUP_RELEASE>
<DATE>1219215682</DATE>
<ORIGINAL_WWWROOT>http://moodle.eschoolconsultants.com</ORIGINAL_WWWROOT>
<ZIP_METHOD>internal</ZIP_METHOD>

Could the problem happen when there is not a full URL in the image source?

Show
Bryce Thornton added a comment - I have had this issue sporadically recently as well. Here is a chunk of data from the XML file: <td bgcolor="#ffffff"> <p align="center"><img title="1212" src="/file.php/4/theater_masks_rocking_back_and_forth_md_clr.gif" border="0" alt="1212" width="130" height="130" /></p> </td> You can see the "/file.php/4/" image source. These were not replaced with the proper id. Here is the top of the XML where a lot of the critical values are set: <?xml version="1.0" encoding="UTF-8"?> <MOODLE_BACKUP> <INFO> <NAME>backup-lit-20080820-0301.zip</NAME> <MOODLE_VERSION>2007101521</MOODLE_VERSION> <MOODLE_RELEASE>1.9.2+ (Build: 20080806)</MOODLE_RELEASE> <BACKUP_VERSION>2008030300</BACKUP_VERSION> <BACKUP_RELEASE>1.9</BACKUP_RELEASE> <DATE>1219215682</DATE> <ORIGINAL_WWWROOT>http://moodle.eschoolconsultants.com</ORIGINAL_WWWROOT> <ZIP_METHOD>internal</ZIP_METHOD> Could the problem happen when there is not a full URL in the image source?
Hide
Petr Škoda (skodak) added a comment -

"/file.php/4/theater_masks_rocking_back_and_forth_md_clr.gif" is not supported, only links with full absolute address starting with http:// are relinked, sorry.

Show
Petr Škoda (skodak) added a comment - "/file.php/4/theater_masks_rocking_back_and_forth_md_clr.gif" is not supported, only links with full absolute address starting with http:// are relinked, sorry.
Hide
Dean Hutt added a comment -

We are still having the same problem even on the same server,

we keep all the previous courses on the server just hidden from the students in an Archive area.

the problem we have is some of the courses have material that has been put into Moodle Web pages, they cut and pasted from the html page and then copied into moodle then the image re attached. this works fine until you have second semester or create another course and then import the material from the course. The images stay linked to the previous course. Then we have to edit each Moodle webpage and change the course number to the correct one. its only the course number that doesn't seem to be changing.

Hope someone is still looking into this.

we are currently using 1.8.4 but will change over the christmas break to 1.9

Thanks
Dean Hutt
Waikato Institute of Technoloy
dean.hutt@wintec.ac.nz

Show
Dean Hutt added a comment - We are still having the same problem even on the same server, we keep all the previous courses on the server just hidden from the students in an Archive area. the problem we have is some of the courses have material that has been put into Moodle Web pages, they cut and pasted from the html page and then copied into moodle then the image re attached. this works fine until you have second semester or create another course and then import the material from the course. The images stay linked to the previous course. Then we have to edit each Moodle webpage and change the course number to the correct one. its only the course number that doesn't seem to be changing. Hope someone is still looking into this. we are currently using 1.8.4 but will change over the christmas break to 1.9 Thanks Dean Hutt Waikato Institute of Technoloy dean.hutt@wintec.ac.nz
Hide
Vicki Dunnam added a comment -

Has this issue been resolved? Here is my situation and not sure if I need to post somewhere else or what. Please advise.

Each semester we create courses and Moodle assigns a course id to each course. Example Course assigned # 22. In the course, we create links to files etc. When the computer generates the link... it uses an "absolute" value example See URL LINK below:

href="http://moodle.mcm.edu/fall2009/file.php/22/Audio/CD5/03%20Track%203.wma"

When you restore this course for another semester, the course ID changes from course ID 22 to a new course ID example 115.

The Link stays the same
href="http://moodle.mcm.edu/fall2009/file.php/22/Audio/CD5/03%20Track%203.wma"

Instead, the link should change from 22 to 115. You can manually change it but there are lots of links in the course and links in questions that have to be changed.

Is there a way to have the computer change the "absolute" links for the files to a "relative" link so it will change the course ID? Right now, you have to open webpages adn look at the HTML code and manually change the course ID number and once that is changed, the link works. This is way to time consuming.

This is a major issue and I need help!!

Show
Vicki Dunnam added a comment - Has this issue been resolved? Here is my situation and not sure if I need to post somewhere else or what. Please advise. Each semester we create courses and Moodle assigns a course id to each course. Example Course assigned # 22. In the course, we create links to files etc. When the computer generates the link... it uses an "absolute" value example See URL LINK below: href="http://moodle.mcm.edu/fall2009/file.php/22/Audio/CD5/03%20Track%203.wma" When you restore this course for another semester, the course ID changes from course ID 22 to a new course ID example 115. The Link stays the same href="http://moodle.mcm.edu/fall2009/file.php/22/Audio/CD5/03%20Track%203.wma" Instead, the link should change from 22 to 115. You can manually change it but there are lots of links in the course and links in questions that have to be changed. Is there a way to have the computer change the "absolute" links for the files to a "relative" link so it will change the course ID? Right now, you have to open webpages adn look at the HTML code and manually change the course ID number and once that is changed, the link works. This is way to time consuming. This is a major issue and I need help!!
Hide
Mark Pearson added a comment -

THIS BUG HAS BEEN FIXED in 1.9.8!!! Wooppee!
Here's the evidence:
On restoring a course with a graphic image as part of the Outline content. In previous versions the URL was encoded as absolute and would break when restored to a different course id. Now however, the URL is encoded as src=\"$@FILEPHP@$$@SLASH@$preview.jpg\" for example and expands correctly to src=\"http://rublev.lly.earlham.edu/~markp/98-moot/file.php/3/preview.jpg\" when the course backup restores. Not only that, but the restore process informs the user that this is happening. KUDOS to the Developers who implemented this!
Another reason to upgrade to the latest 1.9.8!

Show
Mark Pearson added a comment - THIS BUG HAS BEEN FIXED in 1.9.8!!! Wooppee! Here's the evidence: On restoring a course with a graphic image as part of the Outline content. In previous versions the URL was encoded as absolute and would break when restored to a different course id. Now however, the URL is encoded as src=\"$@FILEPHP@$$@SLASH@$preview.jpg\" for example and expands correctly to src=\"http://rublev.lly.earlham.edu/~markp/98-moot/file.php/3/preview.jpg\" when the course backup restores. Not only that, but the restore process informs the user that this is happening. KUDOS to the Developers who implemented this! Another reason to upgrade to the latest 1.9.8!
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it has become inactive and does not appear to affect a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it has become inactive and does not appear to affect a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Dates

  • Created:
    Updated:
    Resolved: