I am using the image module along with product.module. It seems that every day or two, the product thumbnails get deleted out of the files table, but not the actual image in the files directory. This in turn, screws up my layout, because the original is shown instead. I think it might be happening when a product is purchased.

Therefore, I commented out 2 lines in the image.module (lines 321, 322):

function image_update($node) {
  foreach ($node->images as $label => $image) {
    $old_path = db_result(db_query("SELECT filepath FROM {files} WHERE filename='%s' AND nid=%d", $label, $node->nid));
    // This is a new image.
    if ($old_path != $image) {
     /*  file_delete(file_create_path($old_path));
      db_query("DELETE FROM {files} WHERE filename='%s' AND nid=%d", $label, $node->nid); */
      _image_insert($node, $label, file_create_path($image));
    }
  }
}

I'm not sure if this is going to take care of the problem, and perhaps it will screw things up elsewhere, but it's all I could think of doing.

Any help with this or thoughts on the matter?

cheers
alynner

Comments

drewish’s picture

Status: Active » Closed (fixed)

doesn't sound right to me but i'm cleaning out the image issue queue. hopefully this has been resolved.