Zen Cart Logo
Forums / Upgrading to 1.5.x / PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

Views: 3,411

Results 1 to 5 of 5
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

PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

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: PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

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');
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: PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

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: PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

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

16 Jul 2012, 9:36 PM
#5
ksf avatar

ksf

New Zenner

Join Date:
Feb 2008
Posts:
30
Plugin Contributions:
0

Re: PHP Fatal error: 1062:Duplicate entry '1-1' for key 1 when adding attributes

Just had similar issue and the patch worked for me also - THANKS!