AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: gordontaylor on January 28, 2014, 10:10:45 PM

Title: Error When Cloning a Product
Post by: gordontaylor on January 28, 2014, 10:10:45 PM
When adding products the clone button is a life saver, saves soooo much typing.

However, if you clone an item in your product list and then try to clone it again, you get that annoying general error message.

The error log shows an app warning for duplicate entry.

I'm running 1.1.8, but it was the same in 1.1.7 as well.

Not a real pain, but I thought you'd want to know about it.

Quote
2014-01-28 1:00:52 - database error:  AbanteCart core v.1.1.8 Error: Duplicate entry 'new-image-drainable-pouch---18144---filter---2-34-flange---beige' for key 'url_aliases_index'<br />Error No: 1062<br />INSERT INTO ab_url_aliases (`keyword`, `query`, `language_id`) VALUES ('new-image-drainable-pouch---18144---filter---2-34-flange---beige---box-of-10--copy', 'product_id=344', '9')  in <b>/home/theprsku/public_html/wholesaleostomysupplies.com/core/database/mysql.php</b> on line <b>114</b>

There is the particular error, looks like it's coming from my hosting side php. I had an issue with it when trying to upgrade, it wouldn't allow the backup. Abolabo gave me a new php page to replace the one generated when I installed the cart software and contacted my hosting company.

They are running php version 5.3.27 with My SQL Version 5.5.32-cll-lve

Please let me know if this is my hosting companies issue, I think it is.
Title: Re: Error When Cloning a Product
Post by: abolabo on January 29, 2014, 04:04:37 AM
mmm...did you tried to clone the same product twice?
Title: Re: Error When Cloning a Product
Post by: gordontaylor on January 29, 2014, 09:10:14 AM
Yes, if you clone a product more than once, I get that error.

No big deal, if I hit the back button on the browser, it's there and cloned. Just generates that error.
Title: Re: Error When Cloning a Product
Post by: llegrand on January 30, 2014, 09:27:06 AM
Gordon,

FYI,  I just tried it on my system,  it does NOT give me an error.  I can click the clone button on a product several times, and I get a cloned entry for each one - notated (copy) .  Am in version 1.1.8, too.

Lee
Title: Re: Error When Cloning a Product
Post by: gordontaylor on January 30, 2014, 10:23:09 AM
Yep, the error I'm getting seems to be coming from the server side. I had a problem when I upgraded with them as well. Seems like it's the way they have their php configured.
Title: Re: Error When Cloning a Product
Post by: abolabo on January 30, 2014, 10:47:44 AM
Yep, the error I'm getting seems to be coming from the server side. I had a problem when I upgraded with them as well. Seems like it's the way they have their php configured.

try check mysql escaping function in mysql settings inside hosting provider's CPanel
Title: Re: Error When Cloning a Product
Post by: gordontaylor on February 18, 2014, 03:41:00 PM
A little late getting back to you, but yes Escape is enabled.

mysql_real_escape_string enabled

So what's next? I still can't clone a product more than once without generating an error.
Title: Re: Error When Cloning a Product
Post by: JFuchs on February 19, 2014, 04:31:17 PM
I'm having the same issue since 1.1.8 upgrade. It is very frustrating to be able to clone a product only once. As Gordon said, yes you can hit the back button after the error message and the clone is there, however it removes the images (no big deal), but most importantly and a very big deal - it removes ALL Options. That is the worst.
 I have to waste time rebuilding all the options as they are not Global Options, just options created within the individual product. My options have model #s within them, so all the wording stays except the change of a couple numbers (hence why I don't make them permanent global options).
So when I'm adding one product that doesn't offer as many options, I have to delete those option lines (used to be no big deal). To save time, I used to go back two products and clone the last one with the full set of options for my next product build, but now I can't do that. Instead I have to copy the most recent product and rebuild all the option lines. Terribly frustrating, and a huge waste of time compared to 1.1.7.  clone capabilities. I will check the sql configurations on my cpanel, but I'm guessing that won't change anything as Gordon has already done so with no avail.

Title: Re: Error When Cloning a Product
Post by: JFuchs on February 19, 2014, 04:35:15 PM
Please note, I did not experience this problem until I installed the 1.1.8 upgrade. Unlike Gordon, I had no problem cloning an item multiple times in 1.1.7, only since 1.1.8 have I encountered this issue.
Title: Re: Error When Cloning a Product
Post by: gordontaylor on February 19, 2014, 05:19:50 PM
Dimitry has permission to go into my control panel to see if he can find the issue with my host. It appears to be the host, as I have AC installed on another host and this problem does not exist on that hosting server.
Title: Re: Error When Cloning a Product
Post by: JFuchs on February 20, 2014, 01:14:44 PM
Gordon, for the meantime I have figured out solution for us. If you want to clone something for the second time and have everything transfer over perfectly, just change one letter in the product name, hit save, and then clone it. Once the new clone populates, just go back and remove that one letter difference and re-save the original as it was. Works great, and now I don't have to waste time rebuilding my options.  ;D
Title: Re: Error When Cloning a Product
Post by: gordontaylor on February 20, 2014, 01:35:40 PM
Thanks Jon, Dimitry has access to my cPanel and my admin trying to figure it out.
Title: Re: Error When Cloning a Product
Post by: JFuchs on February 20, 2014, 03:48:32 PM
Gordon,
  The plot thickens.
   You won't believe this, but after doing that little trick of changing a letter in the name, saving, cloning, etc; the problem has now fixed itself. I don't have to do that little trick anymore. It works just like it used to. Try it on your site and see if it does the same.  I can clone products multiple times and it transfers everything. ?  ???
Title: Re: Error When Cloning a Product
Post by: gordontaylor on February 20, 2014, 04:04:03 PM
Hmmm, that is too weird indeed.
Title: Re: Error When Cloning a Product
Post by: abolabo on February 24, 2014, 06:05:30 AM
Thanks Jon, Dmitry has access to my cPanel and my admin trying to figure it out.

so.. i confirm bug. To fix it needs to replace file core/helper/utils.php by attached
Title: Re: Error When Cloning a Product
Post by: gordontaylor on February 24, 2014, 09:04:59 AM
Good man...I knew you'd find it!

Works like a charm, thank you Dmitriy...Great detective work!