Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Basic Configuration / Attribute Controller: WARNING: An Error occurred, please refresh the page and try ..

Attribute Controller: WARNING: An Error occurred, please refresh the page and try ..

Started by dmm2020 on 18 Feb 2013, 3:25 AM · Views: 5,497

Results 1 to 20 of 25
18 Feb 2013, 3:25 AM
#1
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Post #1 by dmm2020

This is a nightmare with latest Zencart version. I can't post a url to my admin area obviously and won't but I am using 1.51.

When I go to add options to an attribute drop down type, I immediately get a white page with a lame message "WARNING: An Error occurred, please refresh the page and try again.". It seems that Zencart has gotton more difficult to use and buggy since last time I used it. I want to set up something for my woodcraft hobby but spent all weekend trying to get around this. I originally thought it was due to an URI rewrite mod but I resorted to a vanilla reinstall and still fails.

What is going on? Anyone else experience this and what is the fix?

18 Feb 2013, 3:45 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

A bug!?!?! Yes. One. You happen to have stumbled on the one trouble-causing bug in v1.5.1 ... and the fix for it is explained here: http://www.zen-cart.com/showthread.php?200688-Known-Bugs-%28and-fixes%29-with-v1-5-1&p=1154025#post1154025

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

18 Feb 2013, 3:57 AM
#3
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Post #3 by dmm2020

DrByte:

A bug!?!?! Yes. One. You happen to have stumbled on the one trouble-causing bug in v1.5.1 ... and the fix for it is explained here: http://www.zen-cart.com/showthread.php?200688-Known-Bugs-%28and-fixes%29-with-v1-5-1&p=1154025#post1154025

Thanks for prompt response, but I tried the patch and error still persists. This has to be a huge bug. My setup is crippled until I can find a way around it.

18 Feb 2013, 4:06 AM
#4
drbyte avatar

drbyte

Sensei

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

Post #4 by drbyte

Calm down.

Let's find out the exact error that's causing the generic "WARNING: ..." message to be displayed: http://www.zen-cart.com/content.php?311-warning-an-error-occurred-please-refresh-the-page-and-try-again

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

18 Feb 2013, 4:09 AM
#5
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Post #5 by dmm2020

I enabled strict reporting and error I am getting is: 1062 Duplicate entry '1-1' for key 'PRIMARY'
in:
[insert into dw_products_options_values (products_options_values_id, language_id, products_options_values_name, products_options_values_sort_order) values ('1', '1', 'Recycled Lumber (Pine/Fir)', '1')]

This error has went on from the very beginning. I can create text attributes but any dropdown attribute fails when I attempt to add options to any one of them.

18 Feb 2013, 4:18 AM
#6
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Post #6 by dmm2020

The error logs pointed to a duplicate entry error for "dw_products_options_values". I deleted all the records in that table and went back through the attributes and now I can add options. Probably some complex code not incrementing the counter correctly when creating a new record?

18 Feb 2013, 5:13 AM
#7
drbyte avatar

drbyte

Sensei

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

Post #7 by drbyte

The problem occurs when people manually delete entries from various tables (or selectively import partial records from partial tables from old databases).

The "bug" was a logic flaw in the "fix" intended to resolve a commonly-reported challenge on the forum. Unfortunately the flaw made it past QA undetected.

Thanks for confirming that after applying the correct code fix, clearing the bad data in your database table now allows the code to work as it was intended.

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

28 Feb 2013, 3:52 AM
#8
paperthreads avatar

paperthreads

Zen Follower

Join Date:
Sep 2006
Posts:
142
Plugin Contributions:
0

Post #8 by paperthreads

I applied the new files (patch) as instructed, and I still get the same warning message. I didn't delete or change anything manually in the database, as I am not familiar with how to do this...so what are the steps I need to take to fix this issue if the patch didn't work?

28 Feb 2013, 1:30 PM
#9
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Post #9 by dmm2020

paperthreads:

I applied the new files (patch) as instructed, and I still get the same warning message. I didn't delete or change anything manually in the database, as I am not familiar with how to do this...so what are the steps I need to take to fix this issue if the patch didn't work?

First thing to do before applying ANY plugin is backup both the application and the database. I am a retired Sequel database programmer and pretty much know a lot of MySQL as a result, and have used Zencart on several websites now, so I knew which records to delete. Zencart uses a relational database with tables broken down into individual components. Doing that does shorten the overhead. However, if you delete the wrong data, the results can be unpredictable and bizarre. I do not recommend anyone delete data via phpMyAdmin unless you are absolutely sure what you are doing because you can create a huge mess. I did have a backup but wanted to see what it did, so I went ahead and deleted the records that were causing the plugin to report a duplicate key entry attempt.

There is an admin utility in the plugins to backup your Zencart. You should backup immediately before installing a plugin and use that utility to backup both the application and the database. If you do have a backup, the fix really is to apply the backup or follow the uninstall instructions in the plugin and start again. However, in my case the uninstall procedure on the plugin did not remove faulty data.

If you read the debug logs under /logs/ it will generally tell you that a duplicate key entry was attempted and that gives you the clue to delete those records.

30 Apr 2013, 10:07 PM
#10
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #10 by southshorepizza

[30-Apr-2013 18:01:11] PHP Fatal error: 1062:Duplicate entry '0-1' for key 'PRIMARY' :: INSERT INTO zen_products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 1, 'TEXT') in /home/XXXXXX/public_html/d132s/includes/classes/db/mysql/query_factory.php on line 120

Can someone please interpret this into english and tell me how to resolve the issue?
thank you for your time and help!
i'm using version 1.51

30 Apr 2013, 10:38 PM
#11
ajeh avatar

ajeh

Oba-san

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

Post #11 by ajeh

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 May 2013, 2:35 AM
#13
ajeh avatar

ajeh

Oba-san

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

Post #13 by ajeh

Could you go to the Tools ... Developers Tool Kit ... and in the bottom input box enter:
PRODUCTS_OPTIONS_VALUES_TEXT_ID

and select Admin and click search ...

What comes up on the lines that start with:

$db->Execute("INSERT INTO

and contain the word:

'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!

1 May 2013, 2:46 AM
#14
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #14 by southshorepizza

Attributes_controller.php

Line #39 : $db->Execute("INSERT INTO " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) VALUES (" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . ", " . (int)$languages[$i]['id'] . ", 'TEXT')");

options_name_manager.php

Line #24 : $db->Execute("INSERT INTO " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) VALUES (" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . ", " . (int)$languages[$i]['id'] . ", 'TEXT')");

Line #167 : $db->Execute("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_values_to_products_options_id, products_options_id, products_options_values_id) values (NULL, '" . (int)$_POST['option_id'] . "', '" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . "')");

options_values_manager.php

Line #28 : $db->Execute("INSERT INTO " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) VALUES (" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . ", " . (int)$languages[$i]['id'] . ", 'TEXT')");

1 May 2013, 3:00 AM
#15
ajeh avatar

ajeh

Oba-san

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

Post #15 by ajeh

Can you check the file, on the server:
/your_secret_admin/includes/configure.php

and change that you have a database prefix of 'zen_' set ...

Next, check the database name being used and that it is the same as your the one in the file, on the server:
/includes/configure.php

Next, could you look in phpMyAdmin at your database and browse the table:
zen_products_options_values

how many things have the:
products_options_values_name

for TEXT

What rows have value of 0 for the:
products_options_values_id

Are you using just english or multiple lanaguages?

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 May 2013, 3:26 AM
#16
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #16 by southshorepizza

Can you check the file, on the server:
/your_secret_admin/includes/configure.php
define('DB_PREFIX', 'zen_');
define('DB_SERVER_USERNAME', 'w57dsjmm_zncr1');
define('DB_DATABASE', 'w57dsjmm_zncr1');

and change that you have a database prefix of 'zen_' set ...

Next, check the database name being used and that it is the same as your the one in the file, on the server:
/includes/configure.php
define('DB_PREFIX', 'zen_');
define('DB_SERVER_USERNAME', 'w57dsjmm_zncr1');
define('DB_DATABASE', 'w57dsjmm_zncr1');

Next, could you look in phpMyAdmin at your database and browse the table:
zen_products_options_values

how many things have the:
products_options_values_name

190

for TEXT I can't find anything that says text in this table.

What rows have value of 0 for the:
products_options_values_id
1 item "products_options_values_id" is 0 "products_options_values_name" is blank for this row. "products_options_values_sort_order" is "0"

Are you using just english or multiple lanaguages?**just english

Can I just delete this row since there is no value name? Thank you so much for your help on this!**

1 May 2013, 3:30 AM
#17
ajeh avatar

ajeh

Oba-san

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

Post #17 by ajeh

When you say for TEXT 190, do you mean you have 190 rows?

Do you have any other things in there for products_options_values_name besides TEXT and the blank row?

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 May 2013, 3:44 AM
#18
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #18 by southshorepizza

I have product_options_values but not product_options_values_name

Here is a screen shot.
Attachment 12432

under product_options_type
I have one that has text
Attachment 12433

1 May 2013, 3:52 AM
#19
ajeh avatar

ajeh

Oba-san

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

Post #19 by ajeh

Before we wipe out the Blank one, can you Edit it ad enter for the:
products_options_values_name

TEXT

make sure it is in all CAPS ...

Let's see if that fixes the problem and if not ... we will need to try something else ... :lookaroun

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 May 2013, 4:04 AM
#20
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #20 by southshorepizza

That fixed it. I can now access the attributes controller. :hug: I cannot locate "TEXT" though to delete it. But I guess it really doesn't matter since everything else seems to be working.

Thank you!!!