Skip to content

Commit

Permalink
#167: Correcting ProductsAttribsBasic MySQL error on import.
Browse files Browse the repository at this point in the history
  • Loading branch information
lat9 committed May 14, 2020
1 parent b5a0a25 commit 3efe3ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
@@ -1,7 +1,7 @@
<?php
// -----
// Part of the DataBase I/O Manager (aka DbIo) plugin, created by Cindy Merkin (cindy@vinosdefrutastropicales.com)
// Copyright (c) 2015-2019, Vinos de Frutas Tropicales.
// Copyright (c) 2015-2020, Vinos de Frutas Tropicales.
//
if (!defined('IS_ADMIN_FLAG')) {
exit('Illegal access');
Expand All @@ -21,9 +21,9 @@ class DbIoProductsAttribsBasicHandler extends DbIoHandler
{
public static function getHandlerInformation()
{
DbIoHandler::loadHandlerMessageFile('ProductsAttribsBasic');
DbIoHandler::loadHandlerMessageFile('ProductsAttribsBasic');
return array(
'version' => '1.0.`',
'version' => '1.6.2',
'handler_version' => '1.0.0',
'include_header' => true,
'export_only' => false,
Expand Down Expand Up @@ -183,7 +183,7 @@ protected function importFinishProcessing()

$option_check = $db->Execute(
"SELECT products_options_id FROM " . TABLE_PRODUCTS_OPTIONS . "
WHERE products_options_name = '" . $db->prepare_input ($products_options_name) . "'
WHERE products_options_name = '" . $db->prepare_input($products_options_name) . "'
AND language_id = $language_id
AND products_options_type = " . (int)$products_options_type . "
LIMIT 1",
Expand All @@ -198,11 +198,11 @@ protected function importFinishProcessing()
$products_options_id = $option_check->fields['products_options_id'];

$options_values_names = explode('^', $this->saved_data['option_values']);
$options_values_list = '';
$options_values = array();
foreach ($options_values_names as $current_value_name) {
$options_values_list .= "'$current_value_name', ";
$options_values[] = $db->prepare_input($current_value_name);
}
$options_values_list = dbio_substr($options_values_list, 0, -2);
$options_values_list = "'" . implode("', '", $options_values) . "'";
$options_values_check = $db->Execute(
"SELECT pov.products_options_values_id, pov.products_options_values_name
FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po
Expand Down
4 changes: 2 additions & 2 deletions YOUR_ADMIN/includes/init_includes/init_dbio_admin.php
Expand Up @@ -14,8 +14,8 @@
return;
}

define('DBIO_CURRENT_VERSION', '1.6.2-beta2');
define('DBIO_CURRENT_UPDATE_DATE', '2020-04-09');
define('DBIO_CURRENT_VERSION', '1.6.2-beta3');
define('DBIO_CURRENT_UPDATE_DATE', '2020-05-14');

$version_release_date = DBIO_CURRENT_VERSION . ' (' . DBIO_CURRENT_UPDATE_DATE . ')';

Expand Down
4 changes: 3 additions & 1 deletion docs/dbio/readme.html
Expand Up @@ -588,10 +588,12 @@ <h1 id="title">Database I/O Manager (DbIo) for Zen Cart&reg;</h1>
<noscript><h3>Version History</h3></noscript>
<p>You can view the details of these changes on the plugin's <a href="https://github.com/lat9/dbio/issues" target="_blank">GitHub repository.</a></p>
<ul>
<li>v1.6.2, 2020-04-09:<ul>
<li>v1.6.2, 2020-05-14:<ul>
<li>BUGFIX: Correct &quot;Products&quot; export creating multiple records for multi-lingual stores.</li>
<li>BUGFIX: Correct &quot;ProductsAttribsRaw&quot; check-only import MySQL error when inserting a new download attribute.</li>
<li>BUGFIX: Correct MySQL error when importing using &quot;ProductsAttribsBasic&quot; with option-values containing single-quotes.</li>
<li>The following files were changed or <span class="added">added</span>:<ol>
<li>/YOUR_ADMIN/includes/classes/dbio/DbIoProductsAttribsBasicHandler.php</li>
<li>/YOUR_ADMIN/includes/classes/dbio/DbIoProductsAttribsRawHandler.php</li>
<li>/YOUR_ADMIN/includes/classes/dbio/DbIoProductsHandler.php</li>
<li>/YOUR_ADMIN/includes/init_includes/init_dbio_admin.php</li>
Expand Down

0 comments on commit 3efe3ca

Please sign in to comment.