lat9 / dbio

Database Input/Output for Zen Cart
GNU General Public License v3.0
3 stars 1 forks source link

Product Import Update process #214

Open torvista opened 1 year ago

torvista commented 1 year ago

As I use DBIO infrequently, I forget the detail. So here is issue in the "don't make me think" category.

I just got bogged down trying to import-update a modified previously-exported file, consequently v_products_id and v_products_model both exist with values that exist in the db.

All the entries fail with the same error.

Record at line #X not imported; products_model (XXXXXXXX) exists and cannot, by configuration, be duplicated.

I have DBIO_PRODUCTS_INSERT_REQUIRES_COMMAND set to yes. But in this instance I am not inserting, I am updating, so no command is required.

If the v_products_id is set to 0, the import hinges on the model number and processes correctly updating the products with that model number.

If the v_products_id is maintained and the model has been modified (as so is not in the db), the import hinges on the product id and processes correctly, updating the model number.

I don't think this is intuitive for older people with hangovers. I believe the file should process an update when v_products_id and v_products_model both exist: it should use the products_id as the reference and update the model as per the other fields.