After Restore Resource Links are Broken ex: course/$@DATAVIEWBYID*2313@$

After Restore Resource Links are Broken ex: course/$@DATAVIEWBYID*2313@$

by Amy Wentworth -
Number of replies: 8

We are using Moodle 1.9.+ and after I have restored a course as a New Course the module resources are given a new ID (which I understand) but text and images that were linked to those modules resources in the backup are not updated in the restore with the new ID and are broken.

For Example:

 http://moodle.bcsc.k12.in.us/mod/data/view.php?id=2313  has become  http://moodle.bcsc.k12.in.us/course/$@DATAVIEWBYID*2313@$ instead of http://moodle.bcsc.k12.in.us/mod/data/view.php?id=(NEW ID)

Has anyone had this come up or suggest how I can keep this from happening.  Right now the course owners have to go through and re-link everything.

Thanks.

Average of ratings: -
In reply to Amy Wentworth

Same Problem

by Roger Brüderlin -
I encountered the same problem (Moodle 1.9.3+, 20090114). The strange thing is: I'm siteadmin. When I log in as admin, I cannot reproduce the problem. But teachers still report broken links.
Could there be a connection to SLASH-arguments settings?
In reply to Roger Brüderlin

Re: Same Problem

by ben reynolds -
Hi Roger,
As Site Admin, you can go to any course. Your teachers cannot. Keep an eye on the course IDs when you fail to reproduce the problem. You may be going from one course to another.

I find it easier to test broken links by using the login in as . . . button on a teacher's profile.
In reply to ben reynolds

Solved

by Roger Brüderlin -
Ben: thanks for your reply.

The problem is solved now (but there's still some work to do…).
I moved a course from one moodle-server to another (exactly same moodle-version). When I restored the course, there were several grafics missing and links broken. Then I checked SLASH-arguments on the new server and switched it on. The missing grafics appeared and broken links were ok. So far so good for me. The first server probably had SLASH-arguments on, the second server had turned it off. But I didn't check the course-id-numbers in the links. Just was glad, everything appeared…!
Then I copied this course several times for teachers. And there the problem started: Teachers could not see several grafics and reported broken links. As I had access to the original course as site-admin AND as a teacher, I did not recongnise the problem, even if I used the «login as…»-button. I still seemed to have all permissions to see everything…
I first had to login separatly as a user with normal teacher-permissions (not connected to admin). Then I could reproduce the problem. Checked course-IDs and there it was: the links still pointed to the original course(-ID) wich I copied through backup/restore.
So, there's some work to do: repair broken links… Learned another lessonzwinkernd!
In reply to Roger Brüderlin

Re: Solved

by Allen Cole -
This is still a REAL problem - especially on systems that do a lot of restoring of courses - as we do every semester - a hundred courses to "fix" these image and links which are referring to the original courses ID...a lot of time is spent.

Is there a real fix to this "restore" error? Am I reading this wrong? This "slash" argument does not really fix the issue - with new teachers or participants in these courses. Why is it doing this? Does anyone really know?

I posted this and felt I might have a reason - but it did not turn out to be so -

http://moodle.org/mod/forum/discuss.php?d=109951

I would really love to know if anyone else has fixed or found a fix for this.

Thanks,

Allen Cole
In reply to Allen Cole

Re: Solved

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi,

can anybody attache here (or in the Tracker) one example backup file (no users nor privacy info included) causing that problem?

The automatic link conversion in restore has been working since ages ago and I cannot initially imagine any cause for the problem commented here. Usually causes are

Having one real example could improve the problem detection and fixing a lot.

TIA and ciao smile
In reply to Roger Brüderlin

To be precise…

by Roger Brüderlin -
Just want to put this right:
I assume the problem was caused as I restored the course from one server to another, then switched SLASH on after this first restore process, then made the copies of the course through backup/restore.
The links looked like this: /xyz%F227/folder/document.xls, where 27 is the course-ID, instead of /xyz/27/folder/document.xls.
Without SLASH on, they would look like %F227%F2folder%F2document.xls
There was some mixture of slash and no slash.
In reply to Roger Brüderlin

Re: To be precise…

by Denise Krefting -

I am having the same problem with several of my courses. I have tried a back up from 1.9.6 and restore to the same server, then to a server with 1.9.11 and 1.9.12 . Same problem. I fixed the broken items in the 1.9.11 server and restored to itself and to the 1.9.12.  Same problem.  The images and links are broken from lessons, webpages, and now I have found some in the headers of the section. The images in these courses have all be added through moodle, not copy and paste but viewing the images is inconsistent. Some work and some do not. I can not find any rhyme or reason.  I have gone into the html of the page and searched for the old course ID and replaced it with the new, but I have to restore this course 25 more times.  Please help.