yep that makes perfect sense,
Thanks for the speedy help! :D
Printable View
yep that makes perfect sense,
Thanks for the speedy help! :D
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
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, thanks for your kind words and the feedback that DbIo is helping you.
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:
I'm no coder. Can you give me a clue as to the cause of the problem?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
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:
... 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))) {
$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;
}
}
Thanks for the report and the details, especially that log, which pointed me right to the underlying code issue.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 Cindy, much appreciated.
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())