Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Location
    the netherlands
    Posts
    11
    Plugin Contributions
    0

    bug [Done 1.3.9] options values manager - duplicate rows if more than one lang installed

    The query on line 646 from admin/options_values_manager.php generates duplicate rows.
    Change to 'select distinct... ' to fix.

    Patch against 1.3.5:
    Code:
    --- admin/options_values_manager.php    (revision 356)
    +++ admin/options_values_manager.php    (revision 357)
    @@ -643,7 +643,7 @@
     <?php
         $per_page = MAX_ROW_LISTS_OPTIONS;
     //    $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 where pov.language_id = '" . (int)$_SESSION['languages_id'] . "' and pov2po.products_options_values_id !='" . PRODUCTS_OPTIONS_VALUES_TEXT_ID . "' order by LPAD(pov2po.products_options_id,11,'0'), LPAD(pov.products_options_values_sort_order,11,'0'), pov.products_options_values_name";
    -    $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 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";
    +    $values = "select distinct 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 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";
         if (!isset($_GET['value_page'])) {
           $_GET['value_page'] = 1;
         }

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: The options values manager displays duplicate rows

    We have had no issues with this ...

    What are you doing when you see these duplicate rows?
    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: v1.5.5]
    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!

  3. #3
    Join Date
    May 2006
    Location
    the netherlands
    Posts
    11
    Plugin Contributions
    0

    Default Re: The options values manager displays duplicate rows

    I get the duplicate rows when opening the options value manager, when it displays the list of all option values.

    The rows are duplicated, but not displayed next to each other. For example option ID 2 could be displayed on page 1 and page 20.

    Using this patch we've gone down from 79 to 19 pages of option values.

    We've got about 6 option types and 4 languages installed.

  4. #4
    Join Date
    Sep 2005
    Location
    Hong Kong
    Posts
    307
    Plugin Contributions
    0

    red flag Re: The options values manager displays duplicate rows

    I got the same problem on a 1.3.7 install. 2 languages and only 3 products.

    Please see the screen cap attached.

    Thanks,
    Shirley
    Attached Images Attached Images  

  5. #5
    Join Date
    Sep 2005
    Location
    Hong Kong
    Posts
    307
    Plugin Contributions
    0

    Default Re: The options values manager displays duplicate rows

    Does anyone know how to fix this?

    Thanks !
    Shirley

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: The options values manager displays duplicate rows

    The proper fix is not to use "distinct" but rather to add this into the "where" clause section:
    Code:
    and po.language_id = pov.language_id
    v1.3.7:
    /admin/options_values_manager.php
    line 646 contains:
    Code:
        $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 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";
    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";
    .

    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.

 

 

Similar Threads

  1. Set up more rows than columns
    By dddmx3 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 30 Sep 2010, 10:48 PM
  2. 1062 Duplicate entry '1-1' for key 1 in Options Values Manager
    By willbarraclough in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 28 Sep 2010, 10:53 PM
  3. options values manager
    By nannid in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 16 Jul 2008, 08:28 PM
  4. Replies: 13
    Last Post: 28 Mar 2008, 11:30 PM
  5. [duplicate] Option Values Manager
    By draftdesign in forum Bug Reports
    Replies: 2
    Last Post: 2 Jul 2007, 07:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR