- Posts: 58
- Thank you received: 2
Product code MySQL error
When editing a product code in the back-end, if the code is duplicated (not unique) it generates a MySQL error and breaks the page, instead of displaying an error message that product codes should be unique.
Hika V. 2.0.0
Thanks
Please Log in or Create an account to join the conversation.
It's because the debug mode is activated in your website.
Without debug mode, MySQL does not generate a fatal error but the request is not accepted and HikaShop said that there was a problem while saving the product.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
No, the debug mode isn't on. What happens is that the product_code is unique (and very well) in the database, but if the user tries to set a duplicate product_code it shouldn't throw an slq error, but a warning message telling the user that product codes must be unique and/or that there is already one product with the same code.
Thanks and happy new year for you and the Hika team
Cheers
Please Log in or Create an account to join the conversation.
Which MySQL version are you using ?
It is strange so I think that we have to remake some tests.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
MySql: 5.0.96
PHP: 5.3.17
Hikashop: 2.0.0
Joomla! 3.0.2
Just tested again on a different installation and the same 500 error occurred, when trying to update a product with a product_code that already exists.
Cheers
Please Log in or Create an account to join the conversation.
www.joomla.org/technical-requirements.html
The MySQL version minimum for Joomla 3.0 is 5.1+
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Sorry for not getting back to you earlier but I needed to wait for my isp to update the MySQL server (I didn't want to test this on xampp). Now, on MySQL 5.5.28, the error persists, as I supposed, because this didn't seem like an sql version issue but rather a error throwing instead of warning message as I mentioned earlier. Please correct me if I'm wrong.
Thanks
Please Log in or Create an account to join the conversation.
What we want to say is that what you say it should do is actually what it is doing for us: when we save a product with a code which already exists on Joomla 3.0 we get the error message "A product with the same code already exists" thrown by HikaShop and not a MySQL error. And that's normal since that's how we coded it.
So there must be something else on your website which produces that but I can't tell you what as we are not able to reproduce the problem on our end with the same server configuration.
Please Log in or Create an account to join the conversation.
Well, I've tested it on a fresh clean J3 install, adding two products to a fresh clean Hikashop instal (no customization or coding added) and, with no Error reporting (in J3 global config) set on default level and that's what I get - the 500 error.
For me isn't that important, since I know that no dup product codes should be added
Thanks again Nicolas
Cheers
Please Log in or Create an account to join the conversation.
Note, this happens on update not on new product (sorry if I fooled you
Try opening a product, and update the product code. There you'll get the 500 error.
Please Log in or Create an account to join the conversation.
Ah indeed, I was always trying with new products. I could indeed reproduce the issue with an existing product and fix it. It will be included in next release of HikaShop.
Thank you for your report.
Please Log in or Create an account to join the conversation.
Seems like the 2.1 version corrected the mysql error but... now it displays the nice error message for products which in fact do not have the same code.
Add a product with the code HIKA2.1.0. Now add a product with the code SHOP2.1.1. Go back to HIKA2.1.0 and try to change the code to HIKA2.1.1 - you'll get the error message although there's no other product with the code HIKA2.1.1
Thanks
Please Log in or Create an account to join the conversation.
Download again on our website and update again and that should fix it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.