Forums / Addon Admin Tools / Database I/O Manager (DbIo) Plugin [Support Thread]

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

Views: 104,225

Results 301 to 320 of 621
1 Apr 2020, 1:48 PM
#301
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

It is the way the attribute prices were/are displayed. Setup in 154 displayed attribute price, usually blank for nocharge attributes and sometimes a 5-10% adder. When updated to 156, the displayed attribute price iincluded the attribute price PLUS base price giving the appearance that total product price would be base plus attribute plus base.

The setting (or unsettings) of the priced by attributes flag corrected the issue but the functionality of that flag somehow got changed between versions.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

7 Apr 2020, 4:23 PM
#302
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

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

Got a question, not sure if its what I'm trying to do or something in the code but I'm getting a blank attribute id..
So, history..
ZC1.5.6c
PHP7.3.11
DBIO 1.6.1 from ZC download

Each product gets three file download attributes.

Error log:

[07-Apr-2020 07:02:45 America/Phoenix] Request URI: /ADMIN/dbio_manager.php?action=file, IP address: 0.0.0.0
#1  trigger_error() called at [/************/cbgshop/includes/classes/db/mysql/query_factory.php:171]
#2  queryFactory->show_error() called at [/***********/cbgshop/includes/classes/db/mysql/query_factory.php:143]
#3  queryFactory->set_error() called at [/************/cbgshop/includes/classes/db/mysql/query_factory.php:270]
#4  queryFactory->Execute() called at [ADMIN/includes/classes/dbio/DbIoProductsAttribsRawHandler.php:333]
#5  DbIoProductsAttribsRawHandler->importBuildSqlQuery() called at [ADMIN/includes/classes/dbio/DbIoHandler.php:937]
#6  DbIoHandler->importCsvRecord() called at [ADMIN/includes/classes/dbio/DbIo.php:265]
#7  DbIo->dbioImport() called at [ADMIN/dbio_manager.php:240]
--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 1' at line 4 :: SELECT *
                   FROM zen_products_attributes_download
                  WHERE products_attributes_id = 
                  LIMIT 1 ==> (as called by) ADMIN/includes/classes/dbio/DbIoProductsAttribsRawHandler.php on line 333 <== in /*********/cbgshop/includes/classes/db/mysql/query_factory.php on line 171.

part of the attribute csv file.. 49 products, 3 each for 149 attributes..

v_products_attributes_id,v_products_id,v_products_model,v_manufacturers_name,v_options_id,v_products_options_name,v_options_values_id,v_products_options_values_name,v_options_values_price,v_price_prefix,v_products_options_sort_order,v_product_attribute_is_free,v_products_attributes_weight,v_products_attributes_weight_prefix,v_attributes_display_only,v_attributes_default,v_attributes_discounted,v_attributes_image,v_attributes_price_base_included,v_attributes_price_onetime,v_attributes_price_factor,v_attributes_price_factor_offset,v_attributes_price_factor_onetime,v_attributes_price_factor_onetime_offset,v_attributes_qty_prices,v_attributes_qty_prices_onetime,v_attributes_price_words,v_attributes_price_words_free,v_attributes_price_letters,v_attributes_price_letters_free,v_attributes_required,v_products_attributes_filename,v_products_attributes_maxdays,v_products_attributes_maxcount,v_dbio_command
107,78,Q1149,,13,Topo-NIAP,29,NAIP Quad,1,+,2,1,0,+,0,0,1,maps/NAIP_DIAMOND_POINT.jpg,1,0,0,0,0,0,,,0,0,0,0,0,NAIP_DIAMOND POINT.pdf,7,1,
108,78,Q1149,,13,Topo-NIAP,28,Topo Quad,0,+,1,1,0,+,0,1,1,maps/Quad_DIAMOND_POINT.jpg,1,0,0,0,0,0,,,0,0,0,0,1,Quad_DIAMOND POINT.pdf,7,1,
124,78,Q1149,,13,Topo-NIAP,30,Both Quads,4.65,+,3,1,0,+,0,0,1,maps/Both_DIAMOND_POINT.jpg,1,0,0,0,0,0,,,0,0,0,0,0,Both_DIAMOND_POINT.zip,7,1,
110,80,Q0149,,13,Topo-NIAP,29,NAIP Quad,1,+,2,1,0,+,0,0,1,maps/NAIP_STRAWBERRY.jpg,1,0,0,0,0,0,,,0,0,0,0,0,NAIP_STRAWBERRY.pdf,7,1,
111,80,Q0149,,13,Topo-NIAP,28,Topo Quad,0,+,1,1,0,+,0,1,1,maps/Quad_STRAWBERRY.jpg,1,0,0,0,0,0,,,0,0,0,0,1,Quad_STRAWBERRY.pdf,7,1,
125,80,Q0149,,13,Topo-NIAP,30,Both Quads,4.65,+,3,1,0,+,0,0,1,maps/Both_STRAWBERRY.jpg,1,0,0,0,0,0,,,0,0,0,0,0,Both_STRAWBERRY.zip,7,1,

From some debugging I see that line 324 of DbioProductsAttribsRawHandler.php is creating a empty attribute id

die('attributes id is: ' . $products_attributes_id . ' -2- ' . $table_fields['products_attributes_id']['value'] . ' -3- ' . $this->key_fields['products_attributes_id']);

I was thinking of doing one attribute at a time and see what happens..

Dave
Always forward thinking... Lost my mind!

7 Apr 2020, 4:31 PM
#303
lat9 avatar

lat9

Administrator

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

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

Thanks for the report, @davewest. I'm in the middle of some "stuff" right now so it'll take me a while to see what's going on.

7 Apr 2020, 4:33 PM
#304
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

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

To late to edit... Some attributes exist all products exist.. link to one product with all attributes...

OK.. no rush..

Dave
Always forward thinking... Lost my mind!

7 Apr 2020, 6:02 PM
#305
lat9 avatar

lat9

Administrator

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

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

Dave, would you run that import with the DbIo debug enabled? It'll be a pretty large file; you can send it to me via direct email (PM me and I'll send the email address to you).

If you keep the size of the import CSV to the minimum required to cause the issue, that'll be a big help.

9 Apr 2020, 11:45 AM
#306
lat9 avatar

lat9

Administrator

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

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

lat9:

Dave, would you run that import with the DbIo debug enabled? It'll be a pretty large file; you can send it to me via direct email (PM me and I'll send the email address to you).

If you keep the size of the import CSV to the minimum required to cause the issue, that'll be a big help.
Thanks, @davewest, those logs and additional information helped to pinpoint the root cause.

The issue arises when using the DbIo's "Import (Check-only)" operation for the ProductsAttribsRaw handler when the to-be-imported .csv will result in a new download attribute being created for a given product. I've created the following issue on the DbIo GitHub repository to track the associated change: https://github.com/lat9/dbio/issues/166

9 Apr 2020, 12:00 PM
#307
lat9 avatar

lat9

Administrator

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

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

lat9:

Thanks, @davewest, those logs and additional information helped to pinpoint the root cause.

The issue arises when using the DbIo's "Import (Check-only)" operation for the ProductsAttribsRaw handler when the to-be-imported .csv will result in a new download attribute being created for a given product. I've created the following issue on the DbIo GitHub repository to track the associated change: https://github.com/lat9/dbio/issues/166
Noting that the above GitHub issue has been updated with the required correction.

9 Apr 2020, 2:21 PM
#308
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

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

Importing prices
The products handler can import prices...as the base product price.
The productsAttribsRaw handler can import prices for attributes.

Within a single product range I have products with attributes/colours.

Sometimes all the colours are the same price: I use the product base price and the attributes are at 0.
Sometimes there is a price difference between the attributes: I use a base product price of 0 and each attribute holds the full price.

Currently I have my own frankenfileimporter which finds a way through this from one source file, but I was wondering if
a) is my method the best way?
b) as far as I see, I would need to use/make up two handler files for import using DBIO, based on one price file, to do an update of all these prices.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

9 Apr 2020, 4:03 PM
#309
lat9 avatar

lat9

Administrator

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

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

torvista:

Importing prices
The products handler can import prices...as the base product price.
The productsAttribsRaw handler can import prices for attributes.

Within a single product range I have products with attributes/colours.

Sometimes all the colours are the same price: I use the product base price and the attributes are at 0.
Sometimes there is a price difference between the attributes: I use a base product price of 0 and each attribute holds the full price.

Currently I have my own frankenfileimporter which finds a way through this from one source file, but I was wondering if
a) is my method the best way?
b) as far as I see, I would need to use/make up two handler files for import using DBIO, based on one price file, to do an update of all these prices.
That's pretty much where it stands right now -- one CSV for the product-related pricing and one for the attribute-related price adjustments.

That said, DbIo can be fairly adjustable (when it wants to be). You could create a *common *.csv import, containing those fields that you need from both the products and the products_attributes tables and copy that common file to both DbIoProducts.pricing.csv and DbIoProductsAttribsRaw.pricing.csv (it'll take two imports, but one file).

DbIo (silently) ignores any header-columns that don't apply to the to-be-run import-type.

9 Apr 2020, 5:15 PM
#310
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

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

lat9:

Noting that the above GitHub issue has been updated with the required correction.

Tested with a new product and works grate... thanks.

Dave
Always forward thinking... Lost my mind!

6 May 2020, 8:13 PM
#311
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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

Is there a way to use dbio product handler to move products to new categories? I tried just changing the v_products_categories column to the new category but it doesn't do anything.


Zen Cart and it's community are the best!!

7 May 2020, 11:26 AM
#312
lat9 avatar

lat9

Administrator

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

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

lankeeyankee:

Is there a way to use dbio product handler to move products to new categories? I tried just changing the v_products_categories column to the new category but it doesn't do anything.
There's a fairly long-standing change request (https://github.com/lat9/dbio/issues/135) for this feature. I'll see what I can do to fulfill the request in the next DbIo release.

13 May 2020, 7:41 PM
#313
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

Working in our sandbox to make sure things function as I understand them.
I have POSM installed but assume this export/import is unrelated.
I am using MSFT Excel csv
dbio csv encoding set to latin1
I can see in the debug the attribute causing the issue but anything else is greek to me. I would assume what is exported can be imported without a hiccup but obviously not the case.

Exported filename **dbio.ProductsAttribsBasic.20200513-192105-297090

**Made a couple edits just to make sure things worked.
Imported file
Admin BLANK page
Aww shucks
Exported filename **dbio.ProductsAttribsBasic.20200513-192704-96723
Made NO changes
Imported file
Admin BLANK page

myDEBUG
**```
[13-May-2020 19:27:35 UTC] Request URI: /ADMINFOLDER/dbio_manager.php?action=file, IP address: 98.146.164.107
#1 trigger_error() called at [/home/srevcinf/public_html/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/home/srevcinf/public_html/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/home/srevcinf/public_html/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/home/srevcinf/public_html/ADMINFOLDER/includes/classes/dbio/DbIoProductsAttribsBasicHandler.php:216]
#5 DbIoProductsAttribsBasicHandler->importFinishProcessing() called at [/home/srevcinf/public_html/ADMINFOLDER/includes/classes/dbio/DbIoHandler.php:906]
#6 DbIoHandler->importCsvRecord() called at [/home/srevcinf/public_html/ADMINFOLDER/includes/classes/dbio/DbIo.php:265]
#7 DbIo->dbioImport() called at [/home/srevcinf/public_html/ADMINFOLDER/dbio_manager.php:240]
--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's Pak', 'None')
AND pov.language_id = 1
' at line 3 :: SELECT pov.products_options_values_id, pov.products_options_values_name
FROM products_options_values pov, products_options_values_to_products_options pov2po
WHERE pov.products_options_values_name IN ('16awg JPL-3 Learner's Pak', 'None')
AND pov.language_id = 1
AND pov.products_options_values_id = pov2po.products_options_values_id
AND pov2po.products_options_id = 36 ==> (as called by) /home/srevcinf/public_html/ADMINFOLDER/includes/classes/dbio/DbIoProductsAttribsBasicHandler.php on line 216 <== in /home/srevcinf/public_html/includes/classes/db/mysql/query_factory.php on line 171.[B]

\[/B]

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

14 May 2020, 9:20 AM
#314
lat9 avatar

lat9

Administrator

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

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

Rick, that's a flaw in the ProductsAttribsBasicHandler, no relation to POSM. I've opened this DbIo GitHub issue to track the required change.

14 May 2020, 9:44 AM
#315
lat9 avatar

lat9

Administrator

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

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

lat9:

Rick, that's a flaw in the ProductsAttribsBasicHandler, no relation to POSM. I've opened this DbIo GitHub issue to track the required change.
Correction now available on GitHub; it'll be included in DbIo v1.6.2.

18 May 2020, 5:05 PM
#316
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

Database I/O (DbIo) Manager v1.6.1 (2020-02-12)

Not losing sleep of this, so no rush. I have other things to address.
Live Site:
File export: ProductsAttribsRaw
Import same file before any edit. (511KB)

The reason for export/import without edits is that when I did make a single line insertion, there were errors
dbio logfile is over 900,000 lines long and over 41MB. All I see there is 'ant-races'

Looking at line number 73 in the export/import file.... it is essentially the same as other lines of the similar items.

                      Statistics for the last file imported in the current admin session:
             
[LIST]
[*]Import File Name:/home/chainwea/public_html/MYADMINFOLDER/dbio/dbio.ProductsAttribsRaw.20200518-092909-559660.csv
[*]Operation:import-en-check
[*]Records Read:3555
[*]Records Inserted:0
[*]Records Updated:3553
[*]Warnings:0
[*]Errors:18
[*]Parse Time:9.8524129390717
[/LIST]
         
                      The following warnings/errors were generated by the above action:
             ✗ products_attributes.options_values_id, line #73: Value () is not an integer
             ✗ products_attributes.options_values_price, line #73: Value () is not a floating-point value.
             ✗ products_attributes.product_attribute_is_free, line #73: Value () is not an integer
             ✗ products_attributes.products_attributes_weight, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_display_only, line #73: Value () is not an integer
             ✗ products_attributes.attributes_default, line #73: Value () is not an integer
             ✗ products_attributes.attributes_discounted, line #73: Value () is not an integer
             ✗ products_attributes.attributes_price_base_included, line #73: Value () is not an integer
             ✗ products_attributes.attributes_price_onetime, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_factor, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_factor_offset, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_factor_onetime, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_factor_onetime_offset, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_words, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_words_free, line #73: Value () is not an integer
             ✗ products_attributes.attributes_price_letters, line #73: Value () is not a floating-point value.
             ✗ products_attributes.attributes_price_letters_free, line #73: Value () is not an integer
             ✗ products_attributes.attributes_required, line #73: Value () is not an integer
         
     

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

18 May 2020, 6:08 PM
#317
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

Added the changes for DaveWest but still see the error

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

19 May 2020, 1:21 PM
#318
lat9 avatar

lat9

Administrator

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

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

Rick, I'm not able to recreate your issue. On a zc156c test site with demo products loaded, I exported the ProductsAttribsRaw and then re-imported without any errors.

19 May 2020, 4:39 PM
#319
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

Carp,

I went back and forth yesterday 7 times with errors each time before I typed the post.
Today, first time yielded no errors.

I dunno. The marvels of electrons floating around, I guess.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

23 May 2020, 7:23 PM
#320
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

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

handler: dbio.ProductsAttribsRaw.xxxxx

Removed fields some fields from the base export to eliminate clutter in the spreadsheet
Re-arranged remaining fields to the following order

Fields
v_products_model
v_products_options_values_name
v_options_values_price
v_options_id
v_options_values_id
v_products_attributes_id
v_products_id

Editing many
v_options_values_price

Edited a couple
v_products_model

Saved csv (excel latin1)
Upload csv

Import (FULL)

ALL v_options_values_price values were updated
NONE v_products_model were updated

The expectation was that the v_products_model would have been updated.
Should I use a different handler to edit v_products_model?

The ultimate goal is to add the custom handlers to our existing Excel master price calculator workbook of 100+ worksheets so that price calculations can be significantly automated.

The good thing.... The first time through editing the prices using this handler took the two of us a generous hour which in itself more than halved the time it takes to manually update the attribute pricing.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com