I needed to import information on images stored in IMCEImage fields, so I tried my hand at building a node import 'plug-in'. It's modelled after the ImageField code. It's very rudimentary because it only supports one image per IMCEImage field. Please note that this is my first PHP code, so use it with caution. FYI it should go in the 'supported' directory under the node_import directory.

CommentFileSizeAuthor
imceimage.zip1.38 KBhepabolu

Comments

hepabolu’s picture

Strange thing: when I add two IMCEImage fields to my content type, only the first one imports the data, the second one is not set, even if there are columns mapped to it. It also generates an error:

Column "field_myimage2_imceimage_width" cannot be null query: UPDATE content_type_mytype SET vid = 917, nid = 900, ..., field_myimage2_imceimage_width = NULL, ... WHERE vid = 917 in .../drupal/sites/all/modules/cck/content.module in line 1207.

the accompanying CSV file has a "1" in the column that is mapped to the width field.

The IMCEImage field is not required, so that's not the cause.

This is where I'm lost, since I'm not too familiar with PHP and the inner works of Drupal.

hepabolu’s picture

Title: Rudimentary IMCEImage field support » IMCEImage field support

The error is solved with an updated version of node_import.inc that can be found in http://drupal.org/node/374352#10, not with the original node_import.inc of the 6.x-1.x-dev of 2009-04-22.