Absolute Path in book images

Absolute Path in book images

by Giovanni Agnese -
Number of replies: 2
Hi there,
we have another question about this modulesmile
When we put images in a book page we saw that an absolute link is written into the relative mysql database field.
This isn't a problem but if we would change the host  name of our site we have to rewrite all the "<img src=..." tags. We usually do it with a search & replace into mysql relative fieldssmile
We want to ask you if there is a mode to make book module to refer to the root-> variable of config.php and not tho the host name (to make a relative and not an absolute link). This problem seems to appear only with it and not with the other modules (for examples quizzes shows correctly every image even if we change the host pc).
Thank a lot,
Giovanni & Agnese

Average of ratings: -
In reply to Giovanni Agnese

Re: Absolute Path in book images

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Backup/restore relinks images inside course automaticaly smile

There should be no problems with images, Java, Flash as long as they are from the same course as book. Books links images exactly the same way as resource module.

skodak
In reply to Giovanni Agnese

Re: Absolute Path in book images

by Harsha Balasooriya -

I have the same problem of absolute image path when change the server IP address. 

I have a simple solustion (?) . 

  1. Take backup the given course
  2. Take the zip file to out
  3. Unzip the file
  4. Open moodle.xml
  5. search and replace(if Notepad ctr+H) old IP with new IP
  6. Restore the backup again

I know this is not a real solustion but it ease that manual! thoughtful