Forum OpenACS Q&A: Further problems with ecommerce bulk upload of custom fields

I have set up an ecommerce module with 778 products in it which were uploaded in bulk. The category map was also uploaded in bulk as were the custom fields.

I have discovered that whilst the products and their category associations have uploaded perfectly, the ec_custom_product_field_values table only has 211 rows in it. A study of the product_id values shows that the 211 are not sequential but are distributed throughout the upload recordset.

Jerry Asher's notes at the top of extras-upload-2.tcl say : "
This file updates ec_custom_product_field_values (as opposed to inserting new rows) because upload*.tcl (which are to be run before extras-upload*.tcl) insert rows into ec_custom_product_field_values (with everything empty except product_id and the audit columns) when they insert the rows into ec_products (for consistency with add*.tcl).


I have searched all of the upload*.tcl files to find the section where a db insert is executed but cannot find any such code. The fact that 211 evtries have been made clearly indicates that there is some code somewhere that is making entries in ec_custom_product_field_values but search as I might I cannot find it! I have looked for a trigger on ec_products updates to see if that is the secret but cannot see one. So I am left unable to find any sql that does the inserts into ec_custom_product_field_names that I know have partially succeeded.

I will try writing a manual update query as a quick fix but would like to tie down the problem and report it. Does anyone have any ideas for me - perhaps Jerry Asher may recall.....?

Many Thanks
Richard
Richard,

I'm afraid that is partially my fault. When I cleaned up upload-2.tcl I must have removed the custom fields (by accident). upload-2.tcl wasn't working properly and quite a mess.

Take a look at revision 1.1 at http://cvs.openacs.org/cvs/openacs-4/packages/ecommerce/www/admin/products/upload-2.tcl for a look at the original version. Maybe that you can reconcile this version with the current version.

/Bart

Bart,
I have reconciled the files and can see clearly where the missing code is and what it is. However to test a solution I need to restore an earlier version of the site that I am working on and right at the moment that is awkward.

So I can either summarise and post an 'this ought to do it' fix or leave it until I have fully tested a fix.

Regards Richard
Thanks Richard.

Please upload the patch to big tracker when you've had a chance to test the fix.

/Bart