Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Hello.
Zen Cart 1.5.5.e, DBIO 1.3.0
Ive got 2 issues :
1. When importing products, where i have got 2 duplicate products (same v_products_model id), i receive sql error
Code:
[02-Oct-2017 17:13:58 Europe/Warsaw] Request URI: /Benek/dbio_manager.php?action=file, IP address: 188.146.34.65
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/Benek/includes/classes/dbio/DbIoProductsHandler.php:571]
#5 DbIoProductsHandler->importUpdateRecordKey() called at [/Benek/includes/classes/dbio/DbIoHandler.php:905]
#6 DbIoHandler->importCsvRecord() called at [/Benek/includes/classes/dbio/DbIo.php:250]
#7 DbIo->dbioImport() called at [/Benek/dbio_manager.php:223]
[02-Oct-2017 17:13:58 Europe/Warsaw] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 5)' at line 4 :: INSERT IGNORE INTO zen_products_to_categories
(products_id, categories_id)
VALUES
( , 5) ==> (as called by) /Benek/includes/classes/dbio/DbIoProductsHandler.php on line 571 <== in /includes/classes/db/mysql/query_factory.php on line 167
it seems that $products_id variable is not set.
I made a simple workaround to avoid this error (but i think you have to solve this better ) in dbioProductsHandelr.php line about 564
Code:
if ($table_name == TABLE_PRODUCTS_TO_CATEGORIES) {
if ($this->operation != 'check') {
if ( $products_id != '')
$db->Execute(
"INSERT IGNORE into $table_name
(products_id, categories_id)
VALUES
Second issue :
I put wrong master category path (ia cat_main^subcat1^subcat2) in my import file, after importing all the rows i changed master category path to be correct. But after "update" import the category didnt changed (no change in products_master_categories_id and no change in products_to_categories table)
Is there any way (becaouse there is no Category handler) to update this field and the products_to_categoies table ?
Regards
Marek.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Marek, for the first issue: If your import includes a product duplication, i.e. same products_id/products_model value, and the product does not currently exist, what should happen is that the product is created by the first record imported and then updated by the second.
Either way, DbIo shouldn't be throwing that SQL error and I'll look into this to replicate and correct.
I'll also investigate and report back what's going on with the category-update processing.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Marek, for the first issue: If your import includes a product duplication, i.e. same products_id/products_model value, and the product does not currently exist, what should happen is that the product is created by the first record imported and then updated by the second.
Either way, DbIo shouldn't be throwing that SQL error and I'll look into this to replicate and correct.
I'll also investigate and report back what's going on with the category-update processing.
The first issue has been corrected (see this GitHub issue for details) on the DbIo GitHub repository and will be provided in the next DbIo release. I've also replicated the second issue (see this GitHub issue) and will get that bug squished shortly.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
The first issue has been corrected (see
this GitHub issue for details) on the DbIo GitHub repository and will be provided in the next DbIo release. I've also replicated the second issue (see
this GitHub issue) and will get that bug squished shortly.
Bug squished; see GitHub for details.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Thanks for that; I've replicated the issue on a local testbed and should have a solution in a couple of days.
Correction now available on the plugin's GitHub repository, see this GitHub issue for details; the next release of DbIo will include the corrected processing.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Correction now available on the plugin's GitHub repository, see
this GitHub issue for details; the next release of DbIo will include the corrected processing.
Thanks!
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Correction now available on the plugin's GitHub repository, see
this GitHub issue for details; the next release of DbIo will include the corrected processing.
Excellent. Thank you.
Ive got another question about categories - how to import different categories for 1 product ? Maybe you will code new handler for that ?
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
Coati
Excellent. Thank you.
Ive got another question about categories - how to import different categories for 1 product ? Maybe you will code new handler for that ?
If you're asking how to create "linked products" ... you simply have a Products import that duplicates the product's definition, once for each linked category. The final record for the product will contain the category "path" to the product's master-category.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
I've just submitted v1.3.1 of the DbIo to the Zen Cart plugins for review; once available, it can be downloaded here: https://www.zen-cart.com/downloads.php?do=file&id=2091.
This version contains corrections for the following issues, identified by their GitHub issue number:
#103: Ensure writability of DbIo output directories
#105: (Products) Duplicate records on initial import result in debug log.
#106: (Products/Orders) Customized export can result in incorrect field values.
#107: (Products) Import/update doesn't update master-categories id.
#108: Initialization error on export doesn't display reason to admin.
I'll post back here once it's available for download.
1 Attachment(s)
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Hi all,
I have a question, since a while I am importing new products through dbio manager. The problem with it, is that I have to come up with a new modelnumber for every new product. if i use accidentally the same modelnumber then the product will be overwritten. It takes a lot of time to open every file to get rid of the modelnumbers.
At this moment, I go to the category where I want to add new products, and then I copy one product 10-20 times, and then I use the productnumbers of these new items in the dbio-csv file, then I do not need to add a modelnumber But this also takes a lot of time..
Attachment 17357
Is there a way adding new products without this modelnumber?