-
Re: 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.
-
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:
Code:
[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..
Code:
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
Code:
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..
-
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.
-
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..
-
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.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
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
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
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.
-
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.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
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.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Noting that the above GitHub issue has been updated with the required correction.
Tested with a new product and works grate... thanks.
-
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.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
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.
-
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
Code:
[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.
-
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.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
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.
-
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.
Code:
Statistics for the last file imported in the current admin session:
- 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
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
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Added the changes for DaveWest but still see the error
-
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.
-
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.
-
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.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Rick, the ProductsAttribsRaw handler provides a means to update products' attributes, not their model-numbers. That's what the Products handler does.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
TNX Cindy,
I had a suspicion that was the case but hoped that in the offchance that field might have been editable.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Hi Lat9
I know that the v_dbio_command command is ADD for a new product . Is UPDATE the command to update a product ?
Thanks in advance
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
Hasher
Hi Lat9
I know that the v_dbio_command command is ADD for a new product . Is UPDATE the command to update a product ?
Thanks in advance
Hey, Hasher; no v_dbio_command is used for a product update action, just leave that column empty.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
I am looking for a plugin that can help me make mas product price changes. Can DbIo help me make mass price changes?
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
jodean
I am looking for a plugin that can help me make mas product price changes. Can DbIo help me make mass price changes?
yes, it can
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
I used this plugin to make price changes and it worked flawlessly. This plugin should be made part of the ZenCart release. The only thing I would suggest would be to note in the log if it is an record update verses duplicate.
-
Error with ProductsAttribRaw - Delete from products_attributes_download after INSERT
Hi all,
Have started uploading ProductAttribRaw and having some issues. The 'Import (Check Only)' returns the following as GREEN and set to load all the records.
Numerous records like this:
2020-06-07 15:03:18: importBuildSqlQuery for products_attributes:
INSERT INTO products_attributes (`products_id`, `options_id`, `options_values_id`, `options_values_price`, `price_prefix`, `products_options_sort_order`, `product_attribute_is_free`, `products_attributes_weight`, `products_attributes_weight_prefix`, `attributes_display_only`, `attributes_default`, `attributes_discounted`, `attributes_image`, `attributes_price_base_included`, `attributes_price_onetime`, `attributes_price_factor`, `attributes_price_factor_offset`, `attributes_price_factor_onetime`, `attributes_price_factor_onetime_offset`, `attributes_qty_prices`, `attributes_qty_prices_onetime`, `attributes_price_words`, `attributes_price_words_free`, `attributes_price_letters`, `attributes_price_letters_free`, `attributes_required`)
VALUES (33, 4, 8, 41.95, '', 0, 0, 0.1, '', 0, 0, 1, '', 1, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0)
2020-06-07 15:03:18: importUpdateRecordKey, removing record: DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1
.... Plus another 10 records or so to be INSERT.
However, once I run the Import (Full), I get the 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 'LIMIT 1' at line 1
in:
[DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Assuming it needs a value for the WHERE clause? Why is this not getting picked up after the INSERT?
Am I missing something?
Thanks
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Hi all,
I have started uploading using ProductAttribRaw and having some issues. The 'Import (Check Only)' returns the following as GREEN and ready to load all the records.
Numerous records like this are in the log file post the 'Check':
2020-06-07 15:03:18: importBuildSqlQuery for products_attributes:
INSERT INTO products_attributes (`products_id`, `options_id`, `options_values_id`, `options_values_price`, `price_prefix`, `products_options_sort_order`, `product_attribute_is_free`, `products_attributes_weight`, `products_attributes_weight_prefix`, `attributes_display_only`, `attributes_default`, `attributes_discounted`, `attributes_image`, `attributes_price_base_included`, `attributes_price_onetime`, `attributes_price_factor`, `attributes_price_factor_offset`, `attributes_price_factor_onetime`, `attributes_price_factor_onetime_offset`, `attributes_qty_prices`, `attributes_qty_prices_onetime`, `attributes_price_words`, `attributes_price_words_free`, `attributes_price_letters`, `attributes_price_letters_free`, `attributes_required`)
VALUES (33, 4, 8, 41.95, '', 0, 0, 0.1, '', 0, 0, 1, '', 1, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0)
2020-06-07 15:03:18: importUpdateRecordKey, removing record: DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1
.... Plus another 10 records or so to be INSERT.
However, once I run the Import (Full), I get the 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 'LIMIT 1' at line 1
in:
[DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
***********
Assuming it needs a value for the WHERE clause? Why is this not getting picked up after the INSERT? Or why is it assuming there is a value in products_attributes_download?
Am I missing something?
Thanks
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
gohealth
Hi all,
I have started uploading using ProductAttribRaw and having some issues. The 'Import (Check Only)' returns the following as GREEN and ready to load all the records.
I'm running ZC 1.5.6c on PHP7.3.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
gohealth
I'm running ZC 1.5.6c on PHP7.3.
... and which version of DbIo? There were changes for ProductAttribRaw in v1.6.0 (but use v1.6.1).
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
... and which version of DbIo? There were changes for ProductAttribRaw in v1.6.0 (but use v1.6.1).
Just noticed that I've got changes staged for DbIo v1.6.2's version of that handler that address the issue reported.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
I've just submitted v1.6.2 of DbIo for the Zen Cart plugins moderators for review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#164: Correct duplicate records generated by the Products handler on multi-lingual stores.
#166: ProductsAttribsRaw: Correct MySQL error on 'Import (check)' adding new download.
#167: ProductsAttribsBasic: Correct MySQL error.
#169: Correct PHP 7.4 deprecated use of curly brackets for array functions.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Just noticed that I've got changes staged for DbIo v1.6.2's version of that handler that address the issue reported.
Excellent. I am running 1.6.1, so will download 1.6.2 to address the issues with ProductAttribRaw. Thanks!
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
I've just submitted v1.6.2 of DbIo for the Zen Cart plugins moderators for review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#164: Correct duplicate records generated by the Products handler on multi-lingual stores.
#166: ProductsAttribsRaw: Correct MySQL error on 'Import (check)' adding new download.
#167: ProductsAttribsBasic: Correct MySQL error.
#169: Correct PHP 7.4 deprecated use of curly brackets for array functions.
Thanks, this didn't seem to fix my issue. The issue is on the IMPORT (FULL), not the Check. The IMPORT (Check) however does show what I believe to be the issue during the IMPORT - a DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1
I have installed v1.6.2 of addon, running on ZC 1.5.6c, PHP7.3. When ADDING new ProductsAttribsRaw, I still get the following on IMPORT (Check):
2020-06-08 11:40:35: importBuildSqlQuery for products_attributes:
INSERT INTO products_attributes (`products_id`, `options_id`, `options_values_id`, `options_values_price`, `price_prefix`, `products_options_sort_order`, `product_attribute_is_free`, `products_attributes_weight`, `products_attributes_weight_prefix`, `attributes_display_only`, `attributes_default`, `attributes_discounted`, `attributes_image`, `attributes_price_base_included`, `attributes_price_onetime`, `attributes_price_factor`, `attributes_price_factor_offset`, `attributes_price_factor_onetime`, `attributes_price_factor_onetime_offset`, `attributes_qty_prices`, `attributes_qty_prices_onetime`, `attributes_price_words`, `attributes_price_words_free`, `attributes_price_letters`, `attributes_price_letters_free`, `attributes_required`)
VALUES (33, 4, 4, 41.95, '', 0, 1, 0.1, '', 0, 0, 1, '', 1, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0)
2020-06-08 11:40:35: importUpdateRecordKey, removing record: DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1
The INSERT looks good. The key issue is with the DELETE FROM entry that is created. I'm not sure why on INSERT it is doing a delete from this table?
On Import (FULL), this is the error that is displayed on the browser (ie, not in the log - No log file is actually created. The message gets displayed on browser page /config/dbio_manager.php?action=file):
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 'LIMIT 1' at line 1
in:
[DELETE FROM products_attributes_download WHERE products_attributes_id = LIMIT 1]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Thanks!
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Thanks for the detailed report (I appreciate it). I'll give this a deeper look later today.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Thanks for the detailed report (I appreciate it). I'll give this a deeper look later today.
Days are getting long down here in Florida. I've got a correction staged on GitHub for the v1.6.3 release of DbIo.
Find this method in /admin/includes/classes/dbio/DbIoProductsAttribsRawHandler.php:
Code:
protected function importUpdateRecordKey($table_name, $table_fields, $record_key_value)
{
$proceed_with_update = true;
if ($table_name == TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD) {
if (empty($table_fields['products_attributes_filename']['value'])) {
$proceed_with_update = false;
// -----
// If the current DbIo operation is an import-check, simply output a debug message containing
// the record-deletion SQL. Otherwise, actually run the SQL, removing that record.
//
$sql =
"DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " WHERE products_attributes_id = " . $this->key_fields['products_attributes_id'] . " LIMIT 1";
if ($this->operation == 'check') {
$this->debugMessage("importUpdateRecordKey, removing record: $sql", self::DBIO_STATUS);
} else {
$GLOBALS['db']->Execute($sql);
}
} elseif ($this->import_is_insert) {
$table_fields['products_attributes_id'] = array(
'value' => $record_key_value,
'type' => 'integer',
);
}
}
return ($proceed_with_update) ? $table_fields : false;
}
... and add the highlighted clause:
Code:
protected function importUpdateRecordKey($table_name, $table_fields, $record_key_value)
{
$proceed_with_update = true;
if ($table_name == TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD) {
if (!$this->import_is_insert && empty($table_fields['products_attributes_filename']['value'])) {
$proceed_with_update = false;
// -----
// If the current DbIo operation is an import-check, simply output a debug message containing
// the record-deletion SQL. Otherwise, actually run the SQL, removing that record.
//
$sql =
"DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " WHERE products_attributes_id = " . $this->key_fields['products_attributes_id'] . " LIMIT 1";
if ($this->operation == 'check') {
$this->debugMessage("importUpdateRecordKey, removing record: $sql", self::DBIO_STATUS);
} else {
$GLOBALS['db']->Execute($sql);
}
} elseif ($this->import_is_insert) {
$table_fields['products_attributes_id'] = array(
'value' => $record_key_value,
'type' => 'integer',
);
}
}
return ($proceed_with_update) ? $table_fields : false;
}
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Hey Lat9
I wanted to change categories on products so I downloaded the product file and edited and re-imported. It didn't update changes. I suspect this is because they are existing products and DBio isn't making the new categories . Is there an Dbio command to delete products ?, then I could re-import them as (ADD) new and create the categories .
Thanks for any help!
Paul
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
Hasher
Hey Lat9
I wanted to change categories on products so I downloaded the product file and edited and re-imported. It didn't update changes. I suspect this is because they are existing products and DBio isn't making the new categories . Is there an Dbio command to delete products ?, then I could re-import them as (ADD) new and create the categories .
Thanks for any help!
Paul
Paul, here's the link to the details for the ProductsHandler: https://github.com/lat9/dbio/blob/ma...uctshandler.md
That handler provides both an ADD and REMOVE command.
-
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Thanks once again Lat9 !!
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Hi, I believe there is an issue with DbIo after upgrading from ZC 1.5.6c to 1.5.7. It has been a few days since I upgraded, but the first time trying this since the upgrade. Note, no issues with DbIo on 1.5.6c.
Anyone else having issues with DbIo after upgrading to 1.5.7?
Details:
ZC 1.5.7
PHP Version: 7.3.19 (Zend: 3.3.19)
DbIo Manager v1.6.2 (2020-06-07)
When executing, DbIo simply brings up the drop down to choose the handler, then shows the filters for the chosen handler. Nothing more shows up after the filter section. I would expect to see all the previous files as well as the option to import a file on the right.
Can anyone else check this is the case, or have I stuffed something else up during the upgrade? Apologies as I initially posted this to the Upgrading 1.5.x thread and it is likely more relevant here.
Thanks
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Ah yes, apparently Zen Cart 1.5.7 has done away with the admin-side language class and, instead of simply loading the storefront version, does nothing. That DbIo issue is due to that missing class.
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
I've just submitted DbIo v1.6.3 to the plugin moderators for review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#171: ProductsAttribsRaw: MySQL error on attribute creation
#172: Correct partial whitescreen on zc157 stores (interoperation).
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Hey Lat9
I wanted to change categories on products so I downloaded the product file , deleted the products and re-imported them . That worked well but now the first Product image is broken . I am using IH5 so I have 4 images of the product. First link is broken but the other 3 images are present. I have checked the DB and it looks correct . All 4 images are present on the website.
Any idea what I am missing ?
Thanks in advance!
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Hey, Hasher! What's that first-image (the one that's broken) named?
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Hey Lat9
I use this naming convention.
Product Model = A2067
Image Names
/images/products/A2067/A2067.jpg
/images/products/A2067/A2067_1.jpg
/images/products/A2067/A2067_2.jpg
/images/products/A2067/A2067_3.jpg
Hope this helps !
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Quote:
Originally Posted by
lat9
I've just submitted
DbIo v1.6.3 to the plugin moderators for review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#171: ProductsAttribsRaw: MySQL error on attribute creation
#172: Correct partial whitescreen on zc157 stores (interoperation).
... now available: https://www.zen-cart.com/downloads.php?do=file&id=2091
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Quote:
Originally Posted by
Hasher
Hey Lat9
I use this naming convention.
Product Model = A2067
Image Names
/images/products/A2067/A2067.jpg
/images/products/A2067/A2067_1.jpg
/images/products/A2067/A2067_2.jpg
/images/products/A2067/A2067_3.jpg
Hope this helps !
PM sent.
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Quote:
Originally Posted by
lat9
Confirmed this has corrected both issues.
Thank you Lat9!
-
Re: Database I/O Manager (DbIo) Plugin not working after 1.5.7 upgrade
Quote:
Originally Posted by
gohealth
Confirmed this has corrected both issues.
Thank you Lat9!
... and thanks to you for the confirmation!
-
How to import metatag data?
Have I missed something? I've been through the docs and worked through this thread, but cannot find how to import metatag data?
What is the correct Mapping to get these old EasyPopulate fields into Zen Cart via DBIO:
v_metatags_title_1
v_metatags_keywords_1
v_metatags_description_1
I can export the existing metatags but couldn't see how to import
Thanks in advance
-
Re: How to import metatag data?
There's a built-in customized Products export that will export the current products and their metatags for review/update.
-
Re: How to import metatag data?
Thanks for the quick reply and yes ... but that only includes the product id, model and the various metatag statuses - not the content of the title, keywords and description fields that are stored in the metatags tables. Do we need to customise further?
-
Re: How to import metatag data?
Quote:
Originally Posted by
Ryk
Thanks for the quick reply and yes ... but that only includes the product id, model and the various metatag statuses - not the content of the title, keywords and description fields that are stored in the metatags tables. Do we need to customise further?
What version of DbIo is in use? I'll note that versions prior to v1.6.1 had issues with the products' metatags.
If you're running v1.6.1 or later, you can simply adjust that metatags customized output to include the fields from the meta_tags_products_description table.
-
Re: How to import metatag data?
Thanks Cindy. The client has v155....I'll recommend he upgrades.
-
Re: How to import metatag data?
Yep, DbIo's current version is v1.6.3.
-
product categories - linking
Regarding product categories
Previously
https://www.zen-cart.com/showthread....09#post1336509
Quote:
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.
So the field
is always additive?
If a product already has multiple links and I want to delete those links so only the master category remains in p2c table...?
Is there a way with an import, or I should just use sql?
I would have thought a product should have a column for the master category and another column for additional categories (containing multiple categories) which would replace any already defined...so if empty, remove those defined...?
-
Re: product categories - linking
Quote:
Originally Posted by
torvista
Regarding product categories
Previously
https://www.zen-cart.com/showthread....09#post1336509
So the field
is always additive?
If a product already has multiple links and I want to delete those links so only the master category remains in p2c table...?
Is there a way with an import, or I should just use sql?
I would have thought a product should have a column for the master category and another column for additional categories (containing multiple categories) which would replace any already defined...so if empty, remove those defined...?
@torvista, I'll revisit the products/categories options for a Products import ... as tracked via this GitHub issue: https://github.com/lat9/dbio/issues/178
-
Re: product categories - linking
Quote:
Originally Posted by
lat9
There's an update now available for pre-release testing of v1.6.4 on the DbIo GitHub repository. That release will contain corrections for a couple of issues as well as a change to address this request.
Starting with v1.6.4, the Products import supports an UNLINK 'v_dbio_command' that works in conjunction with the 'v_categories_name' field. Just include the product's ID (or unique products_model), the categories-name 'chain' and the UNLINK command. If the product and category both exist and the category isn't the product's master_categories_id, that unlink operation will succeed.
-
Re: product categories - linking
So, to clarify for the dummies, for an import,
new product
v_categories_name: can be a list. The first path will be the master category. Subsequent paths will be added as linked categories.
existing product
v_categories_name: can be a list. Paths will be added as linked categories, if not already existing for this product.
existing product & using UNLINK command
v_categories_name: can be a list. Paths will be removed only if they are linked categories.
So, to update existing products, it is necessary to export them to get the list of linked categories, to be able to subsequently import and UNLINK them.
-
Re: product categories - linking
Quote:
Originally Posted by
torvista
So, to clarify for the dummies, for an import,
new product
v_categories_name: can be a list. The first path will be the master category. Subsequent paths will be added as linked categories.
existing product
v_categories_name: can be a list. Paths will be added as linked categories, if not already existing for this product.
existing product & using UNLINK command
v_categories_name: can be a list. Paths will be removed only if they are linked categories.
So, to update existing products, it is necessary to export them to get the list of linked categories, to be able to subsequently import and UNLINK them.
Close ...
new product
v_categories_name must be specified (otherwise, you don't know where it goes in the category tree). The last/most-recent v_categories_name imported for a product will be its master-category; previous categories will be linked categories.
existing product
v_categories_name, if specified, identifies the current master-category for the product. Previous categories become linked categories.
existing product & using UNLINK command
v_categories_name must be specified. The category-path will be removed if-and-only-if it is not the product's master-category (an error is indicated if so).
Getting that linked-categories list is going to be a PITA, as the Products-export exports only the product's master-category's name, not the additional linked ones. I'll put such an export on the DbIo to-do list.
-
Re: product categories - linking
I'm afraid I don't find that very intuitive.
I would have thought the first category in any list would be master, the rest....would just be the rest/linked.
And so an export of categories in the products export would include that list.
An import of the products with that column missing would be no change.
An import of the products with that column would update (delete+add), same as the other fields.
The idea of whatever being in the list adding to whatever is already in the db, I find confusing / an unexpected thing and out of step with every other column, in the sense that all the rest will replace the current entry.
Maybe I am used to Apsona doing that....
-
Re: product categories - linking
Quote:
Originally Posted by
torvista
I'm afraid I don't find that very intuitive.
I would have thought the first category in any list would be master, the rest....would just be the rest/linked.
And so an export of categories in the products export would include that list.
An import of the products with that column missing would be no change.
An import of the products with that column would update (delete+add), same as the other fields.
The idea of whatever being in the list adding to whatever is already in the db, I find confusing / an unexpected thing and out of step with every other column, in the sense that all the rest will replace the current entry.
Maybe I am used to Apsona doing that....
Sorry that it's not intuitive ... at least it's documented now!
FWIW, the 'last-in' usage model is similar to the non-Image Handler way of uploading additional images. You edit a product, uploading first those additional images and upload the product's main image as the last step.
-
Re: product categories - linking
Quote:
FWIW, the 'last-in' usage model is similar to the non-Image Handler way of uploading additional images. You edit a product, uploading first those additional images and upload the product's main image as the last step.
Really...never done that! Always used IH.
-
Re: product categories - linking
Hi,
In an old modified version of easypopulate I could import and export all product info and products quantity discounts in one CSV. In a brief look at dbio I don’t think it can do that. If not is it possible to modify dbio to achieve that? I guess otherwise I’d need to upload two CSVs every time there is a product price change.
-
Re: product categories - linking
Quote:
Originally Posted by
RETPL
Hi,
In an old modified version of easypopulate I could import and export all product info and products quantity discounts in one CSV. In a brief look at dbio I don’t think it can do that. If not is it possible to modify dbio to achieve that? I guess otherwise I’d need to upload two CSVs every time there is a product price change.
DbIo currently has the products' quantity discounts, as you indicated, as a separate "handler" from the other products' fields. While anything is possible, code-wise, that quantity-discounts' handling is a bit special and the products' handling is already complicated so I don't think that I'll be combining them.
I guess you're looking at two CSVs when products' pricing changes.
-
Re: product categories - linking
Can't you use one file for all your manipulation (I use Libreofice), with all the column titles as used in both handlers, then save-a-copy two csv files with different names to use the correct handler. Each handler should ignore the columns that are not part of that handler.
Then you are not having to work with two files.
-
Re: product categories - linking
Quote:
Originally Posted by
torvista
Can't you use one file for all your manipulation (I use Libreofice), with all the column titles as used in both handlers, then save-a-copy two csv files with different names to use the correct handler. Each handler should ignore the columns that are not part of that handler.
Then you are not having to work with two files.
You're always thinking, @torvista. That's a great idea.
-
Re: product categories - linking
I've just submitted v1.6.4 of DbIo for the Zen Cart moderators' review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#175: Correct CSV 'split' function processing.
#176: 'Products': Multi-lingual customized-template export columns can 'go off'.
#177: No admin message when multiple v_dbio_command columns are found.
#178: 'Products' import, enable a product to be 'unlinked' from a linked category.
#179: Valid dates that don't start with a year are being indicated as invalid.
#180: Additional configuration setting for Products to require an 'ADD' command to insert a new product.
#181: ProductsAttribsRaw: Unwanted download record added for empty download name.
-
Re: product categories - linking
Quote:
Originally Posted by
lat9
I've just submitted v1.6.4 of DbIo for the Zen Cart moderators' review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#175: Correct CSV 'split' function processing.
#176: 'Products': Multi-lingual customized-template export columns can 'go off'.
#177: No admin message when multiple v_dbio_command columns are found.
#178: 'Products' import, enable a product to be 'unlinked' from a linked category.
#179: Valid dates that don't start with a year are being indicated as invalid.
#180: Additional configuration setting for Products to require an 'ADD' command to insert a new product.
#181: ProductsAttribsRaw: Unwanted download record added for empty download name.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2091
-
Re: product categories - linking
Hi Cindy
A user says
Quote:
The 'DBIO Split File: Record Count' is being ignored. It is set at 60000 which usually produces 6 files, it is currently producing 22!
I have had him confirm that the file itself is correct and not malformed (ie. it's not suddenly over 3 times larger than before), but although he's set it to split at 60000 records per file, it is splitting to around 3000 records per file.
Can you offer any suggestions as to why this might be?
-
Re: product categories - linking
Quote:
Originally Posted by
Ryk
Hi Cindy
A user says
I have had him confirm that the file itself is correct and not malformed (ie. it's not suddenly over 3 times larger than before), but although he's set it to split at 60000 records per file, it is splitting to around 3000 records per file.
Can you offer any suggestions as to why this might be?
Is the user, perhaps, using a version of DbIo prior to v1.6.4? There were corrections for the 'Split' processing in that version.
-
Re: product categories - linking
Thanks - looks like he's still on 1.6.3 - will try the upgrade
-
Re: product categories - linking
I've tried to find my answer because I'm sure it's here but I cannot find it.
My client is/was using Apsona (which no longer works for us) and needs to add products. I'm getting:
✗ products.products_id, line #2: Value () is not an integer
DBIO 1.6.3
ZC 1.536c
I have ADD in v_dbio_command and v_products_id is blank.
What formatting do I need to insert new products?
-
Re: product categories - linking
Quote:
Originally Posted by
jeking
I've tried to find my answer because I'm sure it's here but I cannot find it.
My client is/was using Apsona (which no longer works for us) and needs to add products. I'm getting:
✗ products.products_id, line #2: Value () is not an integer
DBIO 1.6.3
ZC 1.536c
I have ADD in v_dbio_command and v_products_id is blank.
What formatting do I need to insert new products?
You can simply set the v_products_id field to 0 (not an empty string).
-
Re: product categories - linking
Quote:
Originally Posted by
lat9
You can simply set the v_products_id field to 0 (not an empty string).
To an old Staples add, "that was easy". THanks!
-
Re: product categories - linking
Quote:
Originally Posted by
jeking
To an old Staples add, "that was easy". THanks!
Easy is good!
-
Re: product categories - linking
I'm having a small issue that's driving me crazy, I'm using dbio to bring products onto a new Zencart site. However, when uploading new products with a specific ID i would like to keep it seems that dbio is ignoring v_products_id and instead using a generated auto-increment value.
I have looked through the settings and don't believe this is something that can be controlled?
Feel like I'm missing something obvious...
-
Re: product categories - linking
Quote:
Originally Posted by
DannyVarley
I'm having a small issue that's driving me crazy, I'm using dbio to bring products onto a new Zencart site. However, when uploading new products with a specific ID i would like to keep it seems that dbio is ignoring v_products_id and instead using a generated auto-increment value.
I have looked through the settings and don't believe this is something that can be controlled?
Feel like I'm missing something obvious...
You're not missing anything obvious (I'll update the documentation to make it more clear).
If a products_id isn't already present in the database for a Products import, then it's a new product and, to keep the database integrity, a new auto-increment value is assigned. The same holds true for any import: If the auto-incremented 'id' for the to-be-imported table doesn't already exist, the next auto-increment value is assigned on the import.
-
Re: product categories - linking
yep that makes perfect sense,
Thanks for the speedy help! :D
-
Re: product categories - linking
I've just submitted v1.6.5 of DbIo for the Zen Cart moderators' review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#182: Properly handle 'enum' type database fields on import.
#183: Correctly handle 'nullable' fields on import.
-
Re: product categories - linking
Quote:
Originally Posted by
lat9
I've just submitted v1.6.5 of DbIo for the Zen Cart moderators' review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#182: Properly handle 'enum' type database fields on import.
#183: Correctly handle 'nullable' fields on import.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2091
-
Re: product categories - linking
Thanks Cindy,
Too many times we neglect to say thank you for a plugin that fills a significant business need.
Our master Excel pricing workbook has close to 100 worksheets and over a million formula. That's probably not a huge workbook in the overall realm of things but it is pretty big and complex for us. A full website price update takes 2 of us about 3 hours of manual entry from the workbook.
I finally took the time to take 2 dbio csv and embed them into the master workbook and create links to the appropriate worksheet calculations. Now a full price update takes 3 minutes on a slow internet connection day. (dbio.Products and dbio.ProductsAttribsRaw)
File replacement of 1.6.2 to 1.6.5 happening shortly.
-
Re: product categories - linking
Rick, thanks for your kind words and the feedback that DbIo is helping you.
-
Re: product categories - linking
I'll go with RixStix and also add my thanks for a superb tool.
However, I'm having a bit of an issue with a new installation of ZC157 and DBIO1.6.5
When I try to import the file, I get a blank page and the following php error:
Code:
[08-Mar-2021 17:52:45 Europe/London] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function DbIoHandler::importGetLanguageFieldValue(), 2 passed in /includes/classes/dbio/DbIoProductsHandler.php on line 799 and exactly 3 expected in /includes/classes/dbio/DbIoHandler.php:1222
Stack trace:
#0 /includes/classes/dbio/DbIoProductsHandler.php(799): DbIoHandler->importGetLanguageFieldValue('products_name', '1')
#1 /includes/classes/dbio/DbIoHandler.php(870): DbIoProductsHandler->importCheckKeyValue(Array)
#2 /includes/classes/dbio/DbIo.php(265): DbIoHandler->importCsvRecord(Array)
#3 /dbio_manager.php(240): DbIo->dbioImport('dbio.Products.2...', 'run')
#4 /index.php(11): require('/home/xxxx/...')
#5 {main}
thrown in /includes/classes/dbio/DbIoHandler.php on line 1222
I'm no coder. Can you give me a clue as to the cause of the problem?
Many thanks.
-
Re: product categories - linking
Quote:
Originally Posted by
Ryk
I'll go with RixStix and also add my thanks for a superb tool.
However, I'm having a bit of an issue with a new installation of ZC157 and DBIO1.6.5
When I try to import the file, I get a blank page and the following php error:
Code:
[08-Mar-2021 17:52:45 Europe/London] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function DbIoHandler::importGetLanguageFieldValue(), 2 passed in /includes/classes/dbio/DbIoProductsHandler.php on line 799 and exactly 3 expected in /includes/classes/dbio/DbIoHandler.php:1222
Stack trace:
#0 /includes/classes/dbio/DbIoProductsHandler.php(799): DbIoHandler->importGetLanguageFieldValue('products_name', '1')
#1 /includes/classes/dbio/DbIoHandler.php(870): DbIoProductsHandler->importCheckKeyValue(Array)
#2 /includes/classes/dbio/DbIo.php(265): DbIoHandler->importCsvRecord(Array)
#3 /dbio_manager.php(240): DbIo->dbioImport('dbio.Products.2...', 'run')
#4 /index.php(11): require('/home/xxxx/...')
#5 {main}
thrown in /includes/classes/dbio/DbIoHandler.php on line 1222
I'm no coder. Can you give me a clue as to the cause of the problem?
Many thanks.
I can give you more than a clue, how about a correction? FWIW, I've opened this (https://github.com/lat9/dbio/issues/185) GitHub issue to track the forthcoming update.
In your copy of /admin/includes/classes/dbio/DbIoProductsHandler.php, find this section of code on/around line 783 in the DbIo v1.6.5 version:
Code:
// -----
// To 'insert' (i.e. add) a product, the categories_name field must be non-blank and at least one
// of the products_model or products_name, products_url or products description (in at least one of the
// store's languages) must also be non-blank.
//
if ($this->record_status === true) {
$categories_name = $this->importGetFieldValue('categories_name', $data);
if (empty($categories_name)) {
$this->record_status = false;
$this->debugMessage("Record at line#" . $this->stats['record_count'] . " not imported; 'v_categories_name' must be supplied for a product addition.", self::DBIO_WARNING);
} else {
$record_ok = false;
if (!empty($this->importGetFieldValue('products_model', $data))) {
$record_ok = true;
} else {
foreach ($this->languages as $id => $language_id) {
if (!empty($this->importGetLanguageFieldValue('products_name', $language_id))) {
$record_ok = true;
break;
}
if (!empty($this->importGetLanguageFieldValue('products_description', $language_id))) {
$record_ok = true;
break;
}
if (!empty($this->importGetLanguageFieldValue('products_url', $language_id))) {
$record_ok = true;
break;
}
}
}
$this->record_status = $record_ok;
}
}
... and make the highlighted changes:
Code:
// -----
// To 'insert' (i.e. add) a product, the categories_name field must be non-blank and at least one
// of the products_model or products_name, products_url or products description (in at least one of the
// store's languages) must also be non-blank.
//
if ($this->record_status === true) {
$categories_name = $this->importGetFieldValue('categories_name', $data);
if (empty($categories_name)) {
$this->record_status = false;
$this->debugMessage("Record at line#" . $this->stats['record_count'] . " not imported; 'v_categories_name' must be supplied for a product addition.", self::DBIO_WARNING);
} else {
$record_ok = false;
if (!empty($this->importGetFieldValue('products_model', $data))) {
$record_ok = true;
} else {
foreach ($this->languages as $id => $language_id) {
if (!empty($this->importGetLanguageFieldValue('products_name', $language_id, $data))) {
$record_ok = true;
break;
}
if (!empty($this->importGetLanguageFieldValue('products_description', $language_id, $data))) {
$record_ok = true;
break;
}
if (!empty($this->importGetLanguageFieldValue('products_url', $language_id, $data))) {
$record_ok = true;
break;
}
}
}
$this->record_status = $record_ok;
}
}
Thanks for the report and the details, especially that log, which pointed me right to the underlying code issue.
-
Re: product categories - linking
Thanks Cindy, much appreciated.
-
Re: product categories - linking
Another import question.
dbio 1.6.5
zc 156c
Trying to import new products and call myself reading the entire readme several times but the answer might be a snake.
Thus far, I have not been able to add the test product.
using handler
dbio.Products.ProdIDIMPORT.xxx
downloaded the handler, removed columns that are not important "to me"
v_dbio_command either blank or ADD
Excerpt from one of the dbio logs, but no new product to be found in category 229
Code:
2021-03-08 12:14:48: Forcing ADD of product at line #3, via DbIo command
2021-03-08 12:14:48: importBuildSqlQuery for products_description:
INSERT INTO products_description (`products_name`, `products_description`, `language_id`, `products_id`)
VALUES ('Sterling Clasp Assortment 1', 'This is a test description', 1, 0)
2021-03-08 12:14:48: importBuildSqlQuery for products:
INSERT INTO products (`products_model`, `products_sort_order`, `products_image`, `products_weight`, `products_quantity`, `products_type`, `products_price`, `products_status`, `master_categories_id`, `products_tax_class_id`, `products_date_added`)
VALUES ('SSast1', 10, '12ss.jpg', 0.2, 3, 1, 100, 1, 229, 1, now())
-
Re: product categories - linking
Quote:
Originally Posted by
RixStix
Another import question.
dbio 1.6.5
zc 156c
Trying to import new products and call myself reading the entire readme several times but the answer might be a snake.
Thus far, I have not been able to add the test product.
using handler
dbio.Products.ProdIDIMPORT.xxx
downloaded the handler, removed columns that are not important "to me"
v_dbio_command either blank or ADD
Excerpt from one of the dbio logs, but no new product to be found in category 229
Code:
2021-03-08 12:14:48: Forcing ADD of product at line #3, via DbIo command
2021-03-08 12:14:48: importBuildSqlQuery for products_description:
INSERT INTO products_description (`products_name`, `products_description`, `language_id`, `products_id`)
VALUES ('Sterling Clasp Assortment 1', 'This is a test description', 1, 0)
2021-03-08 12:14:48: importBuildSqlQuery for products:
INSERT INTO products (`products_model`, `products_sort_order`, `products_image`, `products_weight`, `products_quantity`, `products_type`, `products_price`, `products_status`, `master_categories_id`, `products_tax_class_id`, `products_date_added`)
VALUES ('SSast1', 10, '12ss.jpg', 0.2, 3, 1, 100, 1, 229, 1, now())
Rick, would you post the DbIo import line associated with those DbIo logs?
-
Re: product categories - linking
Sorry, it looks ugly. I hope I got the commas inserted to help things
Code:
v_products_name_en |
,v_products_id |
,v_products_model |
,v_products_description_en |
,v_products_sort_order |
,v_categories_name |
,v_products_image, |
v_products_weight |
,v_products_quantity |
,v_products_type |
,v_products_price |
,v_products_status |
,v_tax_class_title |
,v_dbio_command |
Sterling Clasp Assortment 1,, |
SSast1, |
This is a test description, |
10 |
,OOPS!!!!, |
12ss.jpg, |
0.2, |
3, |
1, |
100, |
1 |
,Taxable Goods, |
ADD |
-
Re: product categories - linking
Cindy,
FWIW,
I took the full dbio.Product export
Deleted all but the first product & header line
Edited the data in the first line with new product info
Left v_product_id blank
Left dates blank
v_products_ordered blank since the product is new and none ordered/sold
Left all metatag fields blank
v_product_description blank
v_dbio_command ADD
Nothing inserted into v_categories_name ie: category ID 229
Note: This is the first time ever for me to attempt product addition so it is extremely possible for me neglecting a required column
-
Re: product categories - linking
Hi Cindy
Different problem now with the same set up - ZC157, DBIO 165, products handler
On Export, I'm seeing a blank line in the csv, then
Quote:
<style>.block .notice.invalid{display:none;}</style>
on the next line, and the last line of data stops partway through the final product description so on that last product, there is no category info.
Happy to provide csv and log file if you wish.
-
Re: product categories - linking
@rixstix, would you send me a copy of the DbIo log associated with that errant import to my direct email address?
-
Re: product categories - linking
Sure, Ryk. Send those on over the pond via direct email.
-
Re: product categories - linking
Quote:
Originally Posted by
lat9
@rixstix, would you send me a copy of the DbIo log associated with that errant import to my direct email address?
PM. Outlook crashes must have lost it.
-
Re: product categories - linking
email address, that is. We're going to be out and about for a few hours, so it will be late this afternoon.
-
Re: product categories - linking
@Ryk, would you use the site's Tools :: Developers Tool Kit to search all admin files for the string <style>.block .notice.invalid{display:none;}</style>?
It's looking like there's a .php file (?) that has a blank line after its closing ?> that is causing premature output to be generated.
-
Re: product categories - linking
Thank you for the pointer - looks like something related to the template.
If that's NOT the problem, I'll get back to you.
-
Re: product categories - linking
Quote:
Originally Posted by
RixStix
Another import question.
dbio 1.6.5
zc 156c
Trying to import new products and call myself reading the entire readme several times but the answer might be a snake.
Thus far, I have not been able to add the test product.
using handler
dbio.Products.ProdIDIMPORT.xxx
downloaded the handler, removed columns that are not important "to me"
v_dbio_command either blank or ADD
Excerpt from one of the dbio logs, but no new product to be found in category 229
Code:
2021-03-08 12:14:48: Forcing ADD of product at line #3, via DbIo command
2021-03-08 12:14:48: importBuildSqlQuery for products_description:
INSERT INTO products_description (`products_name`, `products_description`, `language_id`, `products_id`)
VALUES ('Sterling Clasp Assortment 1', 'This is a test description', 1, 0)
2021-03-08 12:14:48: importBuildSqlQuery for products:
INSERT INTO products (`products_model`, `products_sort_order`, `products_image`, `products_weight`, `products_quantity`, `products_type`, `products_price`, `products_status`, `master_categories_id`, `products_tax_class_id`, `products_date_added`)
VALUES ('SSast1', 10, '12ss.jpg', 0.2, 3, 1, 100, 1, 229, 1, now())
Rick, got the files via email (thanks). Was the OOPS!!!! category pre-existing when you performed the import, or was it auto-created when this product was imported?