Absolute vs relative links...

Absolute vs relative links...

Eloy Lafuente (stronk7) -
回帖数:3
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像 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 微笑


回复Eloy Lafuente (stronk7)

Re: Absolute vs relative links...

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

回复Gustav W Delius

Re: Absolute vs relative links...

Eloy Lafuente (stronk7) -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像 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. 伤心

An example would be very illustrative...

TIA and ciao 微笑

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