Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Sticky Locked

Views: 159,320

Results 1 to 20 of 42
This thread is locked. New replies are disabled.
10 Dec 2007, 9:17 PM
#1
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Known Bugs (and fixes) with v1.3.8 / v1.3.8a

This thread is a collection of known bugs and their fixes ... specifically applicable to v1.3.8 / v1.3.8a.

FIRST, YOU SHOULD APPLY ALL KNOWN SECURITY PATCHES, as listed here:
http://www.zen-cart.com/forum/showthread.php?t=131115

4 Jan 2008, 4:05 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom:
Center boxes for NEW PRODUCTS and UPCOMING PRODUCTS show Products even when products_status = 0

Solution:
Fix SELECT statements in the two modules:

/includes/modules/new_products.php

This section around lines 40-45

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_id in (" . $list_of_products . ")";

Needs to be updated to:

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_status = 1
                           and p.products_id in (" . $list_of_products . ")";

And then in the:
/includes/modules/upcoming_products.php

around lines 43 to 50

    $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                       where p.products_id = pd.products_id
                       and p.products_id in (" . $list_of_products . ")
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
                       $display_limit .
                       $limit_clause;

to read:

    $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                       where p.products_id = pd.products_id
                       and p.products_status = 1
                       and p.products_id in (" . $list_of_products . ")
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
                       $display_limit .
                       $limit_clause;
4 Jan 2008, 4:07 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: Using PHP 4.3.2 (specifically), cannot stay logged in to the admin area

Cause: Inconsistency in how PHP 4.3.2 vs newer versions of PHP handle sessions.

Solution: See instructions in this post: http://www.zen-cart.com/forum/showpost.php?p=411708&postcount=29

4 Jan 2008, 4:09 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom:
Tax calculation logic for Gift Vouchers.

Solution:
To fix for v1.3.8/1.3.8a you need to edit

includes/modules/order_total/ot_gv.php

at around line 294 you should see this code

        
if ($this->include_tax) {
          reset($order->info['tax_groups']);
          foreach ($order->info['tax_groups'] as $key=>$value) {
            $od_amount['tax_groups'][$key] = $order->info['tax_groups'][$key] * $ratio_tax;
            $tax_deduct += $od_amount['tax_groups'][$key];
          }
        }

you need to comment out that whole block so you get

//        if ($this->include_tax) {
//          reset($order->info['tax_groups']);
//          foreach ($order->info['tax_groups'] as $key=>$value) {
//            $od_amount['tax_groups'][$key] = $order->info['tax_groups'][$key] * $ratio_tax;
//            $tax_deduct += $od_amount['tax_groups'][$key];
//          }
//       }
4 Jan 2008, 4:14 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom:
Admin Category/Product Listing is not showing prices when Customer Authorization is set to 1 or 2 ...

This was originally designed to make the Admin mirror the Catalog ... unfortunately, somebody ... er ... umm ... me ... forgot to finish this section of code so there was an additional switch in place of the customer_id session variable ... :blush:

This means, if you have your shop setup with Customer Authorization and you do not see the Prices in the Catalog ... Categories/Products ... it is because it is first checking if the prices "should" show ... this is not a valid test in the Admin and should be changed so that the Prices always show in the Admin ...

Temporary Solution:
This can be changed with a quick fix of:
/admin/includes/functions/functions_prices.php

  function zen_get_products_display_price($products_id) {
    global $db, $currencies;

    if (false) {
// 0 = normal shopping
// 1 = Login to shop
// 2 = Can browse but no prices
    // verify display of prices
      switch (true) {
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
        // customer must be logged in to browse
        return '';
        break;
        case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
        // customer may browse but no prices
        return '';
        break;
        default:
        // proceed normally
        break;
      }
    }

// show case only
    if (STORE_STATUS != '0') {
      if (STORE_STATUS == '1') {
        return '';
      }
    }

NOTE: the STORE_STATUS is also there to do the same thing, that if you turn off the prices based on STORE_STATUS then the prices would turn off in the Admin as well ...

Both of these will be fixed in v1.4 with a better arrangement of code ...

4 Jan 2008, 4:15 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: When doing checkout with Website Payments Pro and have only downloadable products in the cart (or otherwise don't require shipping for anything), error 10726 appears.
10726 - Invalid Data - There's an error with this transaction. Please enter a complete shipping address.

Cause: Partial shipping information is being sent, when none should be sent at all.

Solution: posted here: http://www.zen-cart.com/forum/showpost.php?p=483782&postcount=4

4 Jan 2008, 8:02 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

This issue exists prior to v1.3.8, and is formally fixed in v1.4.0

Symptom: customer date of birth gets erased when editing customer records from the admin page, if the minimum length for the DOB field is set to zero

Solution: see this thread: http://www.zen-cart.com/forum/showthread.php?t=83839

4 Jan 2008, 9:56 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: If you are using the low-order-fee module and using Linkpoint/Yourpay API payment module in v1.3.8, you will encounter some errors when submitting payments for processing.

Cause: the code wasn't written to support low-order-fee module

Solution: A newer version of this file has been posted here, to handle this bug and another related to coupons:
http://www.zen-cart.com/forum/showthread.php?p=563490#post563490

10 Jan 2008, 7:32 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: On login page with something in your cart, you might see a "Division by zero" warning in module ot_group_pricing.php

Fix: Make the following edit:

/includes/modules/order_total/ot_group_pricing.php
around line 67 you'll see this section of code.
Add the line highlighted:```
function calculate_deductions($order_total) {
global $db, $order;
$od_amount = array();
[B] if ($order_total == 0) return $od_amount;[/B]
$orderTotal = $this->get_order_total();



Discussed here:
<http://www.zen-cart.com/forum/showthread.php?p=487731#post487731>
10 Jan 2008, 7:35 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: In the admin area, when accessing pages that have pulldown menus on them, you might occasionally see a "catchable fatal error in html_output.php".
Happens only in PHP5

Cause: leftover legacy code incompatible with PHP5

Solution: Interim workaround is available by using the patched files posted here:
http://www.zen-cart.com/forum/showpost.php?p=487360&postcount=10

29 Jan 2008, 3:51 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom:
There's a bug in v1.3.8 which only shows when you have
Admin->Configuration->Layout Settings->Categories - Always Show on Main Page = 1

Solution:
To fix it, edit your **/includes/init_includes/init_add_crumbs.php **file, by adding the indicated code, as shown in the highlighted area:```
if ($categories->RecordCount() > 0) {
$breadcrumb->add($categories->fields['categories_name'], zen_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
} elseif(SHOW_CATEGORIES_ALWAYS == 0) {
// if invalid, set the robots noindex/nofollow for this page
$robotsNoIndex = true;
break;
}


<http://www.zen-cart.com/forum/showthread.php?t=87093>
7 Feb 2008, 5:09 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: "Invalid XML" errors when using the v1.3.8 LinkpointAPI payment module on orders which qualify for and select free-shipping.

Solution: http://www.zen-cart.com/forum/showthread.php?p=504397#post504397

14 Feb 2008, 4:09 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Problem: When deleting "ALL attributes" for a given product via the Attributes Controller, AND the product has Download Files attached to it, an error appears, saying:> Fatal error: Cannot use object of type queryFactoryResult as array in /home/mysite/public_html/store/admin/includes/functions/general.php on line 2089

Solution: The coding fix for this particular situation is posted here:
http://www.zen-cart.com/forum/showthread.php?t=88609

23 Feb 2008, 3:30 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Minor issue:

Symptom: HTML-formatted emails generated by Tell-A-Friend always link to main default product-type. For example, if a product_music item was referenced, it would point to product_info instead of product_music_info in the URL.

Fix discussed here: http://www.zen-cart.com/forum/showthread.php?t=89606

3 Mar 2008, 1:57 AM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: Categories Meta Tags cannot be removed once added
http://www.zen-cart.com/forum/showthread.php?t=86882

Solution: Replace the code for the categories meta tags:
/admin/categories.php

And change the code for the categories meta tags to read:

      // bof: categories meta tags
      case 'update_category_meta_tags':
      // add or update meta tags
      //die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
      $categories_id = $_POST['categories_id'];
      $languages = zen_get_languages();
      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
        $language_id = $languages[$i]['id'];
        $check = $db->Execute("select *
                               from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
                               where categories_id = '" . (int)$categories_id . "'
                               and language_id = '" . (int)$language_id . "'");
        if ($check->RecordCount() > 0) {
          $action = 'update_category_meta_tags';
        } else {
          $action = 'insert_categories_meta_tags';
        }

        $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));

        if ($action == 'insert_categories_meta_tags') {
          $insert_sql_data = array('categories_id' => $categories_id,
                                   'language_id' => $language_id);
          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

          zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
        } elseif ($action == 'update_category_meta_tags') {
          if (empty($_POST['metatags_title'][$language_id]) && empty($_POST['metatags_keywords'][$language_id]) && empty($_POST['metatags_description'][$language_id])) {
            $remove_categories_metatag = "DELETE from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " WHERE categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'";
            $db->Execute($remove_categories_metatag);
          } else {
            zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
          }
        }
      }

      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
      break;
      // eof: categories meta tags
3 Mar 2008, 2:22 AM
#17
ajeh avatar

ajeh

Oba-san

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

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: Product Meta Tag leaving blank record

Solution: update the file:
/admin/includes/modules/update_products_meta_tags.php

New Code:

// check if new meta tags or existing
          $check_meta_tags_description = $db->Execute("select products_id from " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " where products_id='" . $products_id . "'");
          if ($check_meta_tags_description->RecordCount() <= 0) {
            $action = 'new_product_meta_tags';
          }
          $languages = zen_get_languages();
          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
            $language_id = $languages[$i]['id'];

            $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                    'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                    'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));

            if ($action == 'new_product_meta_tags') {
              $insert_sql_data = array('products_id' => $products_id,
                                       'language_id' => $language_id);

              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

              zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $sql_data_array);
            } elseif ($action == 'update_product_meta_tags') {
              if (empty($_POST['metatags_title'][$language_id]) && empty($_POST['metatags_keywords'][$language_id]) && empty($_POST['metatags_description'][$language_id])) {
                $remove_products_metatag = "DELETE from " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " WHERE products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'";
                $db->Execute($remove_products_metatag);
              } else {

                zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
              }
            }
          }
          zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
        }

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

3 Mar 2008, 10:03 PM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom:
Unknown column 'o.orders_id' in 'on clause' occurs in the Admin Orders screen when doing a search from the "Search by Product Name or ID:XX or Model" box (the standard "Search" box and Order ID searches work fine).
This happens on MySQL 5.0 and higher.

Solution:
In the /admin/orders.php, from lines 715 thru 750 there are three places where the following is found:from (" . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s " .change each of those to this instead:```
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .




Posted and discussed here: <http://www.zen-cart.com/forum/showthread.php?p=518384#post518384>
6 Mar 2008, 8:57 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Symptom: Using v1.3.8 and Linkpoint/yourpay API module along with a discount coupon would cause a SGS-002301 error to appear along with a message saying subtotals and chargetotal don't match.

Solution: Updated module file posted here: http://www.zen-cart.com/forum/showpost.php?postcount=12&p=519955

NOTE: This fix also incorporates the ot_loworderfee fix posted earlier in this thread.

26 Apr 2008, 7:02 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Known Bugs (and fixes) with v1.3.8 / v1.3.8a

Problem: Back button not working in some instances and you go to the home page vs the last page

Solution: edit the file
/includes/functions/functions_general.php

around lines 989 - 1004 is the function:

////
// Set back button
  function zen_back_link() {
    if (sizeof($_SESSION['navigation']->path)-2 > 0) {
      $back = sizeof($_SESSION['navigation']->path)-2;
      $link = '<a href="' . zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']) . '">';
    } else {
      if (isset($_SERVER['HTTP_REFERER']) && strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {
        $link= $_SERVER['HTTP_REFERER'];
      } else {
        $link = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">';
      }
      $_SESSION['navigation'] = new navigationHistory;
    }
    return $link;
  }

replace it with the following:

////
// Set back button
  function zen_back_link() {
    if (sizeof($_SESSION['navigation']->path)-2 > 0) {
      $back = sizeof($_SESSION['navigation']->path)-2;
      $link = '<a href="' . zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']) . '">';
    } else {
      if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], HTTP_SERVER)) {
        $link= '<a href="' . $_SERVER['HTTP_REFERER'].'">';
      } else {
        $link = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">';
      }
      $_SESSION['navigation'] = new navigationHistory;
    }
    return $link;
  }

Thanks to Absolute for posting this current solution ...

Note: it has been tested to some degree but not to 100% satisfaction ... granted I cannot break it thus far so perhaps it has ... :cool: