Zen Cart Logo
Forums / Bug Reports / [duplicate report] Duplicate option values in admin

[duplicate report] Duplicate option values in admin

Locked

Views: 3,042

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
28 Feb 2008, 5:12 PM
#1
joystick avatar

joystick

New Zenner

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

[duplicate report] Duplicate option values in admin

I'm using ZC 1.3.8(a) ITA. I create an option and when I create value, I see in admin panel two identical entry with some id. For example:

Create Option Name: COLORE (ita) COLOR (eng)

Create Option Value (for COLOR): ROSSO (ita) RED (eng)

I Obtain in admin panel:
ID OPTION NAME OPTION VALUE
3 COLOR ROSSO
3 COLOR ROSSO

Table: products_options
products_options_id language_id products_options_name
3 2 Colore
3 1 Color

Table products_options_values
products_options_values_id language_id products_options_values_name
0 1 TEXT 0
0 2 TEXT 0
2 2 rosso 0
2 1 red 0

Table: products_options_values_to_products_options
products_options_values_to_products_options_id products_options_id products_options_values_id
6 3 2
7 1 3

3 Mar 2008, 2:52 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: [duplicate report] Duplicate option values in admin

The id is the same ... the language content changes ...

3 Mar 2008, 2:11 PM
#3
joystick avatar

joystick

New Zenner

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

Re: [duplicate report] Duplicate option values in admin

Ajeh:

The id is the same ... the language content changes ...

Off course! But there are duplicate values and it isn't correct. In admin panel I see two time value option, identically not only for id. Look: the language is two time italian.

ID OPTION NAME OPTION VALUE
3 COLOR ROSSO
3 COLOR ROSSO

I think that there aren't errors in DB. I think that is a query problem.

http://www.zen-cart.com/forum/showthread.php?t=89246

6 Mar 2008, 1:54 AM
#4
joystick avatar

joystick

New Zenner

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

Re: [duplicate report] Duplicate option values in admin

isn't a bug?

shure it's a query problem. The query on line 646 from admin/options_values_manager.php generates duplicate rows. here the solution.

change by adding extra clause as shown:


$values = "select pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id, pov.products_options_values_sort_order from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po on pov.products_options_values_id = pov2po.products_options_values_id left join " . TABLE_PRODUCTS_OPTIONS . " po on pov2po.products_options_id = po.products_options_id where pov.language_id = '" . (int)$_SESSION['languages_id'] . "' and po.language_id = pov.language_id and pov2po.products_options_values_id !='" . PRODUCTS_OPTIONS_VALUES_TEXT_ID . "' order by po.products_options_name, LPAD(pov.products_options_values_sort_order,11,'0' ), pov.products_options_values_name";