Absolute vs relative links...

Absolute vs relative links...

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

After some tests I've implemented one, first, simple, attempt to recode some absolute links in the backup/restore process.

It makes this transformations:

wwwroot is transformed automatically from original site to new site.
courseid is transformed (in calls to file.php) from original course to new course.

This allows every absolute link in a course (using the file.php script) to be restored successfully. With this modification, every file included in posts, db resources, questions (using the file.php script, I must emphasise it) will be working in destination course/site. This is specially useful when inserting "things" with the HTML Editor (because it uses absolute paths with images, smiles...).

Please, note that this transformations don't solve the "links across modules" problem (links from one forum to other, from one resource to a forum...). I haven't idea about the proper system to do this yet.

Another effect of this transformation is that backup files made with 1.3 developer won't restore with previous versions of Moodle (not backwards compatible) although previous backups will restore (upwards compatible) with 1.3 (without applying the transformations, of course).

Finally, please try this in your test servers. If there is another global transformation to implement, please let me know. But no "inter-module" transformations, please.

Hope it works fine, TIA and ciao, Eloy smile


Average of ratings: -
In reply to Eloy Lafuente (stronk7)

Re: Absolute vs relative links...

by Gustav W Delius -

Thank you Eloy, that is VERY useful. approve.

Why not apply the same principle to dataroot? Just in case someone places absolute links to files there which would be quite acceptable.

And don't give up on your global universal identifier idea. cool

Ciao, Gustav

In reply to Gustav W Delius

Re: Absolute vs relative links...

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 Gustav,

but dataroot isn't in any http url so, what type of transformation are you suggesting? Sorry, but I cannot understand how (where) to apply "the same principle" to that dir. sad

An example would be very illustrative...

TIA and ciao smile

PS: Please, test, test, test....