Forums / Bug Reports / [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

[Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Locked

Started by videorepair on 22 Feb 2012, 6:13 AM · Views: 2,933

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
22 Feb 2012, 6:13 AM
#1
videorepair avatar

videorepair

New Zenner

Join Date:
Aug 2010
Location:
San Antonio, Texas
Posts:
4
Plugin Contributions:
0

[Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

New install of v1.50 with new database. Can not enter any option values after creating option name in admin. Just started this install but this is not my first ZC website. Get "WARNING: An Error occurred, please refresh the page and try again." on top left of a white screen.

Log error: [22-Feb-2012 00:44:54] PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 :: insert into products_options_values
(products_options_values_id, language_id, products_options_values_name, products_options_values_sort_order)
values ('1',
'1',
'Test Option Value',
'10') in /xxxx/xxxx/webxxx/xxxx/www.xxxx.com/public_html/includes/classes/db/mysql/query_factory.php on line 101

Running catalog in ssl mode as well as admin. (Rapidssl 256bit)
Only ad-on is CK_Edit
Already: Reset ALL Products Master Categories ID
: Optimize Database
: Update All Products' Attribute Sort Orders

Any help would be appreciated

22 Feb 2012, 3:05 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

If you have not added any Option Values yet, you can rebuild the table products_options_values with:

TRUNCATE TABLE products_options_values;
INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 1, 'TEXT');

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Feb 2012, 1:20 AM
#3
videorepair avatar

videorepair

New Zenner

Join Date:
Aug 2010
Location:
San Antonio, Texas
Posts:
4
Plugin Contributions:
0

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Thank you very much! Works perfectly! I did not have any option values in the database. Never got past the error. Your patch did the trick!

I owe you one!

23 Feb 2012, 1:34 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Thanks for the update that this fixed the issue for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Aug 2012, 6:35 PM
#5
phanmale avatar

phanmale

New Zenner

Join Date:
Jan 2009
Posts:
50
Plugin Contributions:
0

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Ajeh:

Thanks for the update that this fixed the issue for you ... :smile:

I had exactly the same problem with a new build 1.5, run the SQL query and fixed it for me too!

Thank you :D

8 Aug 2012, 12:11 PM
#6
desertmoon avatar

desertmoon

New Zenner

Join Date:
Oct 2010
Posts:
26
Plugin Contributions:
0

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Ajeh:

If you have not added any Option Values yet, you can rebuild the table products_options_values with:

TRUNCATE TABLE products_options_values;
INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 1, 'TEXT');



I am having this same issue, but I have added options values, can I erase all the option values and use this? If so where does it go? Thank
8 Aug 2012, 1:01 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Are you trying to delete all Option Names and Option Values or just Option Values associated with the Option Names?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Sep 2012, 2:43 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: [Fixed v1.5.1] Fatal error: 1062:Duplicate entry '1-1' for key 1 adding option values

Fixes to accommodate this scenario are included in v1.5.1

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.