I'm finding the Product Length; Width and Height fields don't get created in imported nodes?

FYI, I'm running:

  • PHP 5.2.6
  • MySQL Ver 14.12
  • Drupal 6.15
  • Date 6.x-2.4
  • Node import 6.x-1.x-dev
  • Ubercart 6.x-2.2

I upgraded Node Import from 6.x-1.0-rc4 (2009-Feb-25) to the mentioned DEV version as I was having problems with the taxonomy and product length, width and height.

It is now working pretty well, however, the Product Length, Width and Height fields still don't get passed into the node?

Please note, during the import wizard the product length, width and height get shown on Set file options (step 3 of 8) and Map file columns (step 4 of 8). However, not on Preview import (step 7 of 8) - they are omitted and I just see "Dimensions: cm × cm × cm". Please see attached files for screen shots.

Any chance this will be solved soonish or should I revert back to earlier versions of Drupal Core and Ubercart?

Many thanks for your help.

Comments

imonroe’s picture

I have the same problem, but I'm creating the nodes with a headless drupal script of my own.

I can create nodes all day long, and most of the fields get assigned properly, but for some reason, the atttributes that set thusly:

$node->length = '3';
$node->width = '3';
$node->height = '12';

Don't get saved with the rest of the node.

any idea why?

mikee’s picture

Status: Active » Closed (duplicate)

Hi Ian,

Pleased to say I've got this working using the patch contained below.

http://drupal.org/node/568574.

FYI, the patch contains the following:


Index: supported/ubercart/uc_product.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/supported/ubercart/Attic/uc_product.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 uc_product.inc
--- supported/ubercart/uc_product.inc	9 Oct 2009 15:23:21 -0000	1.1.2.3
+++ supported/ubercart/uc_product.inc	10 Oct 2009 19:30:53 -0000
@@ -64,17 +64,17 @@ function uc_product_node_import_fields($
       'default_value' => variable_get('uc_length_unit', 'in'),
       'weight' => 8,
     );
-    $fields['length'] = array(
+    $fields['dim_length'] = array(
       'title' => t('Length'),
       'group' => t('Product information'),
       'weight' => 9,
     );
-    $fields['width'] = array(
+    $fields['dim_width'] = array(
       'title' => t('Width'),
       'group' => t('Product information'),
       'weight' => 10,
     );
-    $fields['height'] = array(
+    $fields['dim_height'] = array(
       'title' => t('Height'),
       'group' => t('Product information'),
       'weight' => 11,

myregistration’s picture

Thanks so much for sharing your solution, saved me a lot of time!

serra.antonio’s picture

you can also use

$node->dim_width='3';

node_save($node);

rcahana’s picture

Hey i changed

width
length
height

in uc_product.inc

to =>

dim_width
dim_length
dim_height

but it actually doesn't work for me, it tried using both the 1.0 and dev, any suggestions?

in step 7 in the preview i can see:
[length] => 5.25
[width] => 1.75
[height] => 1
but on the live preview i get: Dimensions: in × in × in