CCK imagefield saving procedure
Hi everyone,
I hope someone could help me on my issue with Drupal Ubercart & CCK.
I'm working on upgrading the uc_importer module (http://drupal.org/project/uc_importer) that allows import/export products from ubercart.
This module is compatible with D5 but not D6, and that's what i'm doing.
when importing data, a xml file containing data is parsed and processed. Almost everything is working except for picture of products. It's an CCK field added to a product content type.
The D5-compatible way to do that, according to uc_module, is :
$product->field_image_cache[$i] = array(
'fid' => (file_exists($local_path) ? db_result(db_query("SELECT fid FROM {files} WHERE filepath = '%s'", $local_path)) : 'upload'),
'title' => isset($image->title) ? html_entity_decode((string)$image->title[0]->data(), ENT_QUOTES, "UTF-8") : '',
'alt' => isset($image->alt) ? html_entity_decode((string)$image->alt[0]->data(), ENT_QUOTES, "UTF-8") : '',
'filename' => basename($image_path),
'filepath' => $local_path,
'filesize' => $size,
'filemime' => 'image/'. $path_info['extension'],
);
Do anyone knows how to update this to Drupal 6?
Understanding CCK internal working stuff is a pain in the ass for me... I've to improve, but i'm a little bit late in my schedule, that's why i'm asking some help !!
Thanks :)
