Zen Follower
- Join Date:
- Dec 2011
- Posts:
- 287
- Plugin Contributions:
- 0
Database I/O Manager (DbIo) Plugin [Support Thread]
yep that makes perfect sense,
Thanks for the speedy help! :D
Views: 104,219
Zen Follower
yep that makes perfect sense,
Thanks for the speedy help! :D
Administrator
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.
Administrator
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
Totally Zenned
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.
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Administrator
Rick, thanks for your kind words and the feedback that DbIo is helping you.
Totally Zenned
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:
[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.
Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !
Administrator
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:
[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:
// -----
// 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:
// -----
// 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[B], $data[/B]))) {
$record_ok = true;
break;
}
if (!empty($this->importGetLanguageFieldValue('products_description', $language_id[B], $data[/B]))) {
$record_ok = true;
break;
}
if (!empty($this->importGetLanguageFieldValue('products_url', $language_id[B], $data[/B]))) {
$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.
Totally Zenned
Thanks Cindy, much appreciated.
Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !
Totally Zenned
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
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
RixStix (dot) com
aka: ChainWeavers (dot) com
Administrator
RixStix:
Another import question.
dbio 1.6.5
zc 156cTrying 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
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?
Totally Zenned
Sorry, it looks ugly. I hope I got the commas inserted to help things
[TABLE="width: 896"]
[TR]
[TD]v_products_name_en[/TD]
[TD],v_products_id
[/TD]
[TD],v_products_model
[/TD]
[TD],v_products_description_en
[/TD]
[TD],v_products_sort_order
[/TD]
[TD],v_categories_name
[/TD]
[TD],v_products_image,
[/TD]
[TD]v_products_weight[/TD]
[TD],v_products_quantity
[/TD]
[TD],v_products_type
[/TD]
[TD],v_products_price
[/TD]
[TD],v_products_status
[/TD]
[TD],v_tax_class_title
[/TD]
[TD],v_dbio_command
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]Sterling Clasp Assortment 1,,
[/TD]
[TD]SSast1,
[/TD]
[TD]This is a test description,
[/TD]
[TD="align: right"]10[/TD]
[TD],OOPS!!!!,
[/TD]
[TD]12ss.jpg,
[/TD]
[TD="align: right"]0.2,
[/TD]
[TD="align: right"]3,
[/TD]
[TD="align: right"]1,
[/TD]
[TD="align: right"]100,
[/TD]
[TD="align: right"]1[/TD]
[TD],Taxable Goods,
[/TD]
[TD]ADD[/TD]
[/TR]
[/TABLE]
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Totally Zenned
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
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Totally Zenned
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
<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.
Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !
Administrator
@rixstix, would you send me a copy of the DbIo log associated with that errant import to my direct email address?
Administrator
Sure, Ryk. Send those on over the pond via direct email.
Totally Zenned
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.
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Totally Zenned
email address, that is. We're going to be out and about for a few hours, so it will be late this afternoon.
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Administrator
@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.
Totally Zenned
Thank you for the pointer - looks like something related to the template.
If that's NOT the problem, I'll get back to you.
Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !
Administrator
RixStix:
Another import question.
dbio 1.6.5
zc 156cTrying 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
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?
Tell staff why this post should be reviewed.