Restore is breaking and renaming links

Restore is breaking and renaming links

by Tiffany Morgan -
Number of replies: 7
On the original course I have a lable in the summary that links to a resource (create a webpage resource type) within topic one. The link for the resource goes to http://.../mod/resource/view.php?id=19284. In the same label I hae a link to the eMail module we are using which is
http://.../blocks/email_list/email/index.php?id=6

When I restore the course from a back up the new course has the link to
the resource pointing to
http://.../course/$@RESOURCEVIEWBYID*19284@$ Which of course
gives me a 404 error.

The link to the email remains pointing http://.../blocks/email_list/email/index.php?id=6 which sends you back to the email module for the original course.
My questions are:
1. What in the restore feature causes the resource links to be
treated different than the module/activity links?

2. Is there a hack or different process for either
making the restore feature treat all the links the same, or even
better, update the links to the new course id (example resource would
update to new resource
http://.../mod/resource/view.php?id=27754 [27754 being the new resource id] and email link would
update to http://.../blocks/email_list/email/index.php?id=130 [130 being the new course id] )

Background on this, in case you are wondering, we have implemented a menu in the summary that links to items so we can hide all the topics and avoid the "scroll of death".

Thanks!
Average of ratings: -
In reply to Tiffany Morgan

Re: Restore is breaking and renaming links

by ben reynolds -
Hi T,
I've had this a few times, and I *think* it happens when I've made the link as an admin or teacher in edit mode as opposed to not in edit mode on the main classroom page.
In reply to ben reynolds

Re: Restore is breaking and renaming links

by Tiffany Morgan -
Hi Ben
Thanks for the reply, but I'm not quite sure I follow...
I set up each of the classes as the admin, so that part I understand. And we have teachers that have set up classes in edit mode. How you would you set up and edit a class but not be in edit mode? or do you mean you import/restore while in the edit on mode?

Sorry for my confusion...Its early on a Monday smile
In reply to Tiffany Morgan

Re: Restore is breaking and renaming links

by ben reynolds -
Nevermind. I was wrong. I've run into this problem, but no longer remember how it happened.

Are you seeing this problem w/ just one resource or for all resources in the label?
In reply to ben reynolds

Re: Restore is breaking and renaming links

by ben reynolds -
Follow up. T has jinxed me.

Restore produced this bad link in one of my classrooms.

http://bluejay.cty.jhu.edu/mod/lesson/$@ASSIGNMENTVIEWBYID*14455@$

What's interesting, at least to me, about this is we use a template course from which we make a backup, and then we restore the backup. The links are good in the template.

We made two restorations. Only one came up w/ the bad link, which points back to the template's assignment ID.

I've got a whole lesson in which restore has broken while translating links that point from a lesson page to an activity. All the broken links have $@ASSIGNMENTVIEWBYID* or $@FORUMVIEWBYID* etc. all pointing at the template course's assignment or forum id number.

This isn't a complaint. Just documenting that gremlins prowl the innards of our server.
In reply to ben reynolds

Re: Restore is breaking and renaming links

by Tiffany Morgan -
I AM a moodle jinx! Think I do it to myself too! smile

Here is what I have been able to figure out:
1. It only produces the bad links on those icons that link to a resource within the course. So if make a link in course1 to resource1 it works just fine. Once I restore that course to make course2 the link turns to that link you like you show above. BUT if I were to scroll down to resource1 within course2 I can access that content without problems.

My guess as to what is causing this is when I make a new course via restore it replicates the content, but gives all of the resources new ids. When I make an absolute link pointing to a specific resource id and it cant find that resource it automatically changes the url to @RESOURCEVIEWBYID*9999@$

I get why the link wouldnt work since the resource id is no longer in the course, I just wish there was a way to prevent it from making up a new url on its on.

2. Its only on the label in my course, but that is because that is the only place I am linking to things within the course.

A new thing to note as well in this is, sometimes the images I am using on the label as icons do not update and continue pointing to the old course files to find the image. This works fine if you are the admin and there for have rights to every course. It can go and find the image in the other course. If you are a student or teacher and not enrolled in the other course, it cant find the image and therefore wont display it. The odd part is there seems to be no rhyme or reason to this. Sometimes all the images update just fine, sometimes they dont....


In reply to Tiffany Morgan

Re: Restore is breaking and renaming links

by E. L. Cooper -
Just a suggestion but have you tried to back up the course without users and restore it?
In reply to E. L. Cooper

Re: Restore is breaking and renaming links

by Tiffany Morgan -
Well I back up everything in the course, but when I restore I do not restore the user data...

Haven't tried with no user data in the back up AND not user data selected in the restore