OC 2.3.1 with a database imported from OC 1.5.6 with latest Pekka's migration tool.
Clean Arastta 1.0.6 with freshly installed extension.
If I try to import a database I get an error:
Clean Arastta 1.0.6 with freshly installed extension.
If I try to import a database I get an error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Notice</b>: Error: 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 '' at line 1Error No: 1064INSERT INTO `oc_address` (`address_id`, `customer_id`, `firstname`, `lastname`, `company`, `address_1`, `address_2`, `city`, `postcode`, `country_id`, `zone_id`, `custom_field`) VALUES ('9', '8', '***', '***', '', '***', '', '***', '***', '***'; in <b>/mnt/wwwhost/****/system/library/db/mysqli.php</b> on line <b>49</b>
In Extensions
Share this post:
Responses (30)
-
Accepted Answer
-
Accepted Answer
Here it is
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Notice</b>: Error: 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 '' at line 1Error No: 1064INSERT INTO `oc_address` (`address_id`, `customer_id`, `firstname`, `lastname`, `company`, `address_1`, `address_2`, `city`, `postcode`, `country_id`, `zone_id`, `custom_field`) VALUES ('9', '8', '*', '*', '', '*', '', '*', '*', '176'; in <b>/mnt/wwwhost/test-ar/system/library/db/mysqli.php</b> on line <b>49</b><b>Notice</b>: Error: 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 '' at line 1Error No: 1064INSERT INTO `oc_address` (`address_id`, `customer_id`, `firstname`, `lastname`, `company`, `address_1`, `address_2`, `city`, `postcode`, `country_id`, `zone_id`, `custom_field`) VALUES ('13', '12', '*', '*', '', '*', '', '*', '*', '176', '0'; in <b>/mnt/wwwhost/test-ar/system/library/db/mysqli.php</b> on line <b>49</b><b>Notice</b>: Error: 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 '' at line 1Error No: 1064INSERT INTO `oc_address` (`address_id`, `customer_id`, `firstname`, `lastname`, `company`, `address_1`, `address_2`, `city`, `postcode`, `country_id`, `zone_id`, `custom_field`) VALUES ('15', '14', '*', '*', '', '*', '', '*', '*'; in <b>/mnt/wwwhost/test-ar/system/library/db/mysqli.php</b> on line <b>49</b><b>Notice</b>: Error: 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 '' at line 1Error No: 1064INSERT INTO `oc_address` (`address_id`, `customer_id`, `firstname`, `lastname`, `company`, `address_1`, `address_2`, `city`, `postcode`, `country_id`, `zone_id`, `custom_field`) VALUES ('18', '17', '*', '*', '', '*', '', '*', '*', '176', '0'; in <b>/mnt/wwwhost/test-ar/system/library/db/mysqli.php</b> on line <b>49</b><b>Notice</b>: Error: 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 '' at line 1Error No: 1064INSERT INTO `oc_address` (`address_id`, `customer_id`, `firstname`, `lastname`, `company`, `address_1`, `address_2`, `city`, `postcode`, `country_id`, `zone_id`, `custom_field`) VALUES ('30', '29', '*', '*', '', '*', '', '*', '*', '176', '0'; in <b>/mnt/wwwhost/test-ar/system/library/db/mysqli.php</b> on line <b>49</b><b>Notice</b>: Undefined offset: 27 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 28 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 29 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 30 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 31 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 32 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 33 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 34 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 35 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 36 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 37 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 38 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 39 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 40 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 41 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 42 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 43 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 44 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 45 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 46 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 47 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 48 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 49 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 50 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 51 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 52 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 53 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 54 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 55 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 56 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 57 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 58 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 59 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 60 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Error: 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 ''PayPal' at line 1Error No: 1064INSERT INTO `oc_order` (`order_id`, `invoice_no`, `invoice_prefix`, `store_id`, `store_name`, `store_url`, `customer_id`, `customer_group_id`, `firstname`, `lastname`, `email`, `telephone`, `fax`, `payment_firstname`, `payment_lastname`, `payment_company`, `payment_address_1`, `payment_address_2`, `payment_city`, `payment_postcode`, `payment_country`, `payment_country_id`, `payment_zone`, `payment_zone_id`, `payment_address_format`, `payment_method`, `payment_code`, `shipping_firstname`, `shipping_lastname`, `shipping_company`, `shipping_address_1`, `shipping_address_2`, `shipping_city`, `shipping_postcode`, `shipping_country`, `shipping_country_id`, `shipping_zone`, `shipping_zone_id`, `shipping_address_format`, `shipping_method`, `shipping_code`, `comment`, `total`, `order_status_id`, `affiliate_id`, `commission`, `language_id`, `currency_id`, `currency_code`, `currency_value`, `ip`, `forwarded_ip`, `user_agent`, `accept_language`, `date_added`, `date_modified`, `custom_field`, `payment_custom_field`, `shipping_custom_field`, `marketing_id`, `tracking`) VALUES ('45792', '0', '*', '0', '*', '*', '5', '1', '*', '*', '*', '*', '', '*', '*', '', '*', '', '*', '*', '*', '176', '', '0', '', 'PayPal ; in <b>/mnt/wwwhost/test-ar/system/library/db/mysqli.php</b> on line <b>49</b><b>Notice</b>: Undefined offset: 26 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 27 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 28 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 29 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 30 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 31 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 32 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 33 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 34 in <b>/mnt/wwwhost/test-ar/admin/model/tool/opencart.php</b> on line <b>158</b><b>Notice</b>: Undefined offset: 35 in <b>/mnt/wwwhost/test -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
Thx, found it.
Very short in time right now, but after a first look, the content (length) of $data_value is different than $data_key (line 106 and 117).
That is why this error occures:
Undefined offset: 27 in /mnt/wwwhost/test-ar/admin/model/tool/opencart.php on line 158
Guess this will be reason why the closing ) is missing.
Sorry, can not check right now, I am on the way. -
Accepted Answer
I think, I've found the problem. You are using
explode('(', $value);
and if there are braces anywhere in text, the script will fail.
BTW, why in the line 109 is $check = strpos($data_key[1], ")"); instead of $check = strpos($data_key[$i], ")");?
for ($i = 0; $i < count($data_key); $i++) {
$check = strpos($data_key[1], ")");
if ($check !== false) {
$var = explode(')', $data_key[$i]);
$data_key[$i] = $var[0];
}
}
-
Accepted Answer
-
Accepted Answer
This update don't solve the problem with braces and other such symbols in database (there are many in oc_orders, oc_settings). I've changed the script and it seems to be working for my data. I have only the problem with importing google analytics script, but it's easier to add this manually.
Here is my model/opencart.php.
I would say that is better way to make the changes directly in database, how it's done in Pekka's opencart 1.x -> 2.x converter. -
Accepted Answer
-
Accepted Answer
That seems to be filtered by our firewall because of being a PHP file.
Andrey, can you please send a Pull Request via GitHub so that we could evaluate it?
https://github.com/arastta/addons/tree/master/tools/ext_opencart2_arastta
Regards -
Accepted Answer
-
Accepted Answer
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »