Ubercart Products - Dimensions are required for custom packaging
| Project: | Node import |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
| Issue tags: | ubercart |
When running a node import job for Ubercart Products (Ubercart version 6.x-2.0-rc6) there is a fatal import error for each item with the following text 'Dimensions are required for custom packaging'. This error is generated by the 'uc_ups_product_alter_validate' method in Ubercart shipping module 'uc_ups.module'. This error is generated when physical dimensions of a product are not specified.
The current implementation of the Ubercart Product import does have a mapping for product dimension i.e. length, width, and height. However, the values read from the import source are not being properly mapped so that when 'uc_ups_product_alter_validate' is executed the dimension values are all zero.
I do have a workaround. In the 'node_import' module you can update the file 'uc_product.inc' under folder 'supported/ubercart'. You must change the array's dimension keys to have a prefix of 'dim_'. For example, change $fields['length'] to $fields['dim_length']. This will allow the import to work properly. As a result of this change it seems that the import wizard will not automatically map columns named without the 'dim_' prefix to the appropriate dimension field. But of course you can do this manually.

#1
Just wanted to confirm that this does work and attach a patch for the fix neliason describes.
#2
#3
Came up with the same solution, should have checked for a patch first.
This works.
#4
I've just tested the patch and I've correctly imported the dimensions field (ubercart 2.0). Without the patch it wasn't possible to import those fields.