Closed Tangol closed 6 years ago
Warning: You do not have permission to modify Export / Import (XLSX) !
2018-03-12 13:11:28 - PHP Fatal Error: Uncaught Error: Call to undefined method ModelToolExportImport::validateWorksheetNames() in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php:5326
Stack trace:
#0 C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php(5762): ModelToolExportImport->validateUpload(Object(PHPExcel))
#1 C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\controller\tool\export_import.php(30): ModelToolExportImport->upload('C:\\Bitnami\\wamp...', true)
#2 C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\system\engine\front.php(41): ControllerToolExportImport->upload()
#3 C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\system\engine\front.php(28): Front->execute(Object(Action))
#4 C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\index.php(159): Front->dispatch(Object(Action), Object(Action))
#5 {main}
thrown in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 5326
oc_product.csv
export first, then tried to import the same file).The issues above are fixed, but I have another question.
How is the Export / Import (CSV) system supposed to work? For example, I did a test by taking the following steps:
oc_product.csv
Catalog - Products
and deleted all productsoc_product.csv
Result: the products didn't appear back in the Catalog, but are present in the database...
I think the reason they don't show back is because the original product_ids have been deleted and the product table auto-increment is now offset. This is why I placed a warning message about not changing any of the ids. The CSV method is most useful for small updates, like price changes, or as an optional backup, but it is not recommended for large scale Add/Delete operations.
The CSV method is most useful for small updates, like price changes, or as an optional backup, but it is not recommended for large scale Add/Delete operations.
If you can't import the data and have it show up in the store, then this feature is kind of useless. That would be the main purpose of the Import/Export system. To export data, modify it, then import it back into the store.
Also, found another issue (XLSX).
products-2018-03-13.xlsx
Catalog - Products
and deleted all productsproducts-2018-03-13.xlsx
Result:
Yes (Update and/or add data)
2018-03-13 14:06:41 - PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 1229
2018-03-13 14:06:41 - PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 1255
2018-03-13 14:06:41 - PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 1257
2018-03-13 14:06:41 - PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 1285
2018-03-13 14:06:41 - PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 1286
2018-03-13 14:06:41 - PHP Exception: Error: Duplicate entry '11-0' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO `oc_manufacturer_to_store` SET manufacturer_id = '11', store_id = '0' in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\system\database\mysqli.php on line 39
No (Delete all old data before Import)
2018-03-13 14:08:51 - PHP Exception: 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 ''12'' at line 1<br />Error No: 1064<br />ALTER TABLE
oc_url_aliasAUTO_INCREMENT = '12' in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\system\database\mysqli.php on line 39
I've noticed that currently, both Export/Import systems (XLSX and CSV) are unstable. I'll do my best to test and report everything, as the ability to import and export stuff, is the most important feature of OpenCart.
Another error for the XLSX Incremental Import (Update and/or add data), when all products are deleted and trying to import a previously exported products-2018-03-14.xlsx
file.
2018-03-14 10:10:19 - PHP Notice: Undefined variable: description in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\admin\model\tool\export_import.php on line 278
2018-03-14 10:10:19 - PHP Exception: Error: Duplicate entry '11-0' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO `oc_manufacturer_to_store` SET manufacturer_id = '11', store_id = '0' in C:\Bitnami\wampstack-7.0.22-1\apache2\htdocs\oce\system\database\mysqli.php on line 39
I have re-instated the previous PHPExcel library and Model. It is now working again but will need more fine tuning to make it perfect. I think this issue should now be closed. ... and possibly a fresh one open later if new problems are found.
Please note that any user group, regardless of the Modify Permission, can Export XLSX.
Import XLSX and Export / Import (CSV) work fine and you get the:
Warning: You do not have permission to modify Export / Import XLSX - (CSV)!
message when you try to take an action.Tested on https://github.com/villagedefrance/OpenCart-Overclocked/commit/33b66b969e3f5e2670d044682dde840e637f3b34