I recently upgraded my site to 4.7.0 RC3 and I think most of the upgrade process went smooth.
Only the updates of the image paths in the nodes seems not to have occurred. This page is a good example:
http://www.tortels.be/infobundel/wie_is_wie/welpenleiding
On the left are some images lost. Their path is still image/view/374/thumbnail, the old path when the base href was still there...
Is there anything I can do about it?

Comments

sokrat’s picture

Trouble is using relative path. But, need absolute.
Eg:
http://www.tortels.be/infobundel/wie_is_wie/welpenleiding + image path.
but need
http://www.tortels.be/ + image path.

Try update your image.module (from cvs repository)

Apply this patch also in image.module:

function _image_insert($node, $label, $image) {
  // Don't duplicate images when a derivative == _original
  if (($label != '_original') && ($image == file_create_path($node->images['_original']))) {
    return;
  }

  $dest = _image_filename(basename($image));
  if (file_copy($image, $dest)) {
    $info = image_get_info(file_create_path($dest));
    $file->filename = $label;
    $file->filepath = _image_filename(basename($image));
    $file->filemime = $info['mime_type'];
    $file->filesize = filesize(file_create_path($dest));
    $fid = db_next_id('{files}_fid');
    db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', '%s')",
             $fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
    <strong>db_query("INSERT INTO {file_revisions} (fid, vid, description) VALUES (%d, %d, '%s')",
             $fid, $node->vid, ''); //sk patch (delete list)</strong>
  }
}
serval-1’s picture

thanks a lot for your reply. I am using the cvs version now and I have executed the update-image.php.
This gave me the following error:

	Table 'sn0789_drupal.image' doesn't exist query: SELECT * FROM image
 in /scoutnet.be/users/tortels/public_html/includes/database.mysql.inc op lijn 120.
serval-1’s picture

I have patched my code, but still no images
Probably new inserted images will do this well, but I have a lot of pages with relative image links... Is there anything I can do about it apart from manually editing all my pages :)

Thx alot in advance

SimonVlc’s picture

I have exactly this same problem after upgrading. Is there any solution?

Thanks in advance, Simon.

serval-1’s picture

Simply editing and saving a page (without changing anyting) seems to give me the pictures back. Not a real solution especially when you have a lot of nodes...

Does it work for you too? I have changed some other settings too, so probably there is some more work to do to get the 'fix' there.