Download & Extend

Support for importing files and images in latest version

Project:Flexinode to CCK Converter
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:critical
Assigned:Unassigned
Status:active

Issue Summary

Ok, after testing of the head version, I'm opening a separate issue in the queue (as the other concerns the old 4.7 version). The current version doesn't handle properly files and image fields, and I think it's important to do that.

The files are simply not processed: the fields are created, but no data is imported. That is because there needs to be an actual "file" created in the new file API for imagefield (for example) to function properly. imagefield_file_insert() expects a $file['filename'] to be passed from imagefield_field($op = insert, ...). The filename is passed down from the content_field() hook, which we interoperate with through the $resave object (line 459). We would need, there, to have a special case for images and files that will set the 'filename' parameter in that array. Maybe something like this:

if ($type->name == 'imagefield' /* not sure */) {
              $resave->$field_name = array(array('filename' => $fnode->textual_data));
}

This needs more thinking about before it gets anywhere close to resolution.