Product code MySQL error

  • Posts: 58
  • Thank you received: 2
11 years 4 months ago #83582

Hi,
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.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 4 months ago #83661

Hi,

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.
The following user(s) said Thank You: mcruip

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 2
11 years 4 months ago #83662

HI Jerome,

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.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 4 months ago #83668

Hi,

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.

  • Posts: 58
  • Thank you received: 2
11 years 4 months ago #83669

Hi,

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

Last edit: 11 years 4 months ago by mcruip.

Please Log in or Create an account to join the conversation.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 4 months ago #83838

Hi,

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.

  • Posts: 58
  • Thank you received: 2
11 years 3 months ago #85114

Hi Jerome,
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

Last edit: 11 years 3 months ago by mcruip.

Please Log in or Create an account to join the conversation.

  • Posts: 81598
  • Thank you received: 13082
  • MODERATOR
11 years 3 months ago #85240

Hi,

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.

  • Posts: 58
  • Thank you received: 2
11 years 3 months ago #85248

Hi Nicolas,
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 ;) but I reported it just in case you've missed something. Anyway, if it's working fine on your side, that's great as long as you don't have any reports ;)
Thanks again Nicolas
Cheers

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 2
11 years 3 months ago #85250

Hi Nicolas,
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.

  • Posts: 81598
  • Thank you received: 13082
  • MODERATOR
11 years 3 months ago #85531

Hi,

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.

The following user(s) said Thank You: mcruip

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 2
11 years 2 months ago #89065

Hi Nicolas,
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.

  • Posts: 81598
  • Thank you received: 13082
  • MODERATOR
11 years 2 months ago #89161

Thanks for the feedback. That's fixed.
Download again on our website and update again and that should fix it.

The following user(s) said Thank You: mcruip

Please Log in or Create an account to join the conversation.

  • Posts: 58
  • Thank you received: 2
11 years 2 months ago #89165

;) Fixed! Thank you Nicolas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum