If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Admin Tools / Database I/O Manager (DbIo) Plugin [Support Thread]

Database I/O Manager (DbIo) Plugin [Support Thread]

Started by lat9 on 1 Jul 2016, 6:09 PM · Views: 104,845

Results 101 to 120 of 628
24 Sep 2017, 10:33 AM
#101
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Post #101 by ladyofthecave

I have also tried to double the model and id-colums, to change place of these columns and many other variables, but for some reason the manager doesn't see these two columns..

24 Sep 2017, 10:55 AM
#102
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Post #102 by ladyofthecave

Could it maybe has something to do with this? (when I try to make a new template, the two missing columns are already there and cannot being moved). I have the impression that the manager sees only the manually attached template fiels, not the two that are already there, because these two columns are missing.....

Attachment 17327

24 Sep 2017, 11:39 AM
#103
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #103 by lat9

LadyoftheCave:

Goodmorning all,

I have a question about importing csv-files with new products. I have downloaded a product-csv file with the dbio manager, and then I changed the products and I have uploaded it to the webstore throught the dbio manager, but then I received the following message:

Foutmelding The current import-file is missing these (v_products_id, v_products_model) required columns; the import is disallowed.

> 
> But when I check the file on the missing columns, they are just there into the file..
> 
> Attachment 17326

When you are performing a product *insert*, the v_products_model column is what DbIo uses to determine that the product is new.  The products_id values are automatically calculated by the database; you have no control over those for a product insert/create operation.
24 Sep 2017, 11:41 AM
#104
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #104 by lat9

LadyoftheCave:

Could it maybe has something to do with this? (when I try to make a new template, the two missing columns are already there and cannot being moved). I have the impression that the manager sees only the manually attached template fiels, not the two that are already there, because these two columns are missing.....

Attachment 17327
Nope, when you create a DbIo template, there are sometimes (like for the Products handler) database fields that are required. The Products handler requires that the v_products_id and v_products_model fields both be present in the import ... even though (as you found) the v_products_id value has no bearing when the product is being created.

24 Sep 2017, 11:48 AM
#105
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Post #105 by ladyofthecave

lat9:

When you are performing a product insert, the v_products_model column is what DbIo uses to determine that the product is new. The products_id values are automatically calculated by the database; you have no control over those for a product insert/create operation.

Hi lat9, thank you for your answer. I am not completely sure what you mean:blush:, but do you know how I can insert product-files without this error? Do I have to remove the id column?

24 Sep 2017, 12:41 PM
#106
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #106 by lat9

You'll need to keep the v_products_id column (set that value for new products to 0) and supply a unique v_products_model value for a new product to be created.

When creating a new product, you'll also want to make sure that you have the v_categories_name column set to identify the category "tree" associated with the to-be-added product's master-category.

When you're performing any kind of import, I suggest that you first perform an Import (Check-only) first. That processing will do every step of the import ... except that the database is not updated. You can then see what will happen before actually committing the information to your database.

Once the import is finished, a link shows next to the action-selection dropdown that reads View import details; click that link and a popup will display showing you the status of that import.

After you've verified your import-csv using Import (Check-only), that's the time to use Import (Full) which will actually write the requested information to your database.

24 Sep 2017, 12:47 PM
#107
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Post #107 by ladyofthecave

thank you very much,

I will try that out now :)

24 Sep 2017, 1:07 PM
#108
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Post #108 by ladyofthecave

lat9:

You'll need to keep the v_products_id column (set that value for new products to 0) and supply a unique v_products_model value for a new product to be created.

When creating a new product, you'll also want to make sure that you have the v_categories_name column set to identify the category "tree" associated with the to-be-added product's master-category.

When you're performing any kind of import, I suggest that you first perform an Import (Check-only) first. That processing will do every step of the import ... except that the database is not updated. You can then see what will happen before actually committing the information to your database.

Once the import is finished, a link shows next to the action-selection dropdown that reads View import details; click that link and a popup will display showing you the status of that import.

After you've verified your import-csv using Import (Check-only), that's the time to use Import (Full) which will actually write the requested information to your database.

Hi lat9,

I have tried that out:

Attachment 17328

But I still receive the same error message about the missing columns..

Foutmelding The current import-file is missing these (v_products_id, v_products_model) required columns; the import is disallowed.

24 Sep 2017, 1:15 PM
#109
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #109 by lat9

PM sent.

24 Sep 2017, 1:55 PM
#110
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #110 by lat9

It turns out that the message that @LadyoftheCave was receiving was because the import CSV file was using a semi-colon (;) instead of the more traditional comma (,) as the field delimiter.

Updating the DbIo's Configuration->DbIo Manager Settings->CSV Delimiter to ; allows the import to proceed without error.

3 Oct 2017, 9:58 AM
#111
coati avatar

coati

New Zenner

Join Date:
Oct 2017
Location:
Warsaw
Posts:
2
Plugin Contributions:
0

Post #111 by coati

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
[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

        if ($table_name == TABLE_PRODUCTS_TO_CATEGORIES) {
            if ($this->operation != 'check') {
[B]if ( $products_id != '')[/B]
                $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.

3 Oct 2017, 11:50 AM
#112
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #112 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.

3 Oct 2017, 4:45 PM
#113
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #113 by lat9

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.

3 Oct 2017, 8:31 PM
#114
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #114 by lat9

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.

3 Oct 2017, 8:33 PM
#115
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #115 by lat9

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.

3 Oct 2017, 9:04 PM
#116
johnies avatar

johnies

New Zenner

Join Date:
Jun 2015
Posts:
9
Plugin Contributions:
0

Post #116 by johnies

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!

4 Oct 2017, 10:53 AM
#117
coati avatar

coati

New Zenner

Join Date:
Oct 2017
Location:
Warsaw
Posts:
2
Plugin Contributions:
0

Post #117 by coati

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 ?

4 Oct 2017, 11:51 AM
#118
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #118 by lat9

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.

4 Oct 2017, 1:21 PM
#119
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,152
Plugin Contributions:
56

Post #119 by lat9

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.

13 Oct 2017, 10:58 AM
#120
ladyofthecave avatar

ladyofthecave

Zen Follower

Join Date:
Jan 2016
Location:
Netherlands
Posts:
150
Plugin Contributions:
0

Post #120 by ladyofthecave

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?