Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    629
    Plugin Contributions
    0

    Default Lots of Debug files over and over.

    Code:
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    This morning, while uploading a couple of dozen new products and cleaning up some import errors, I started getting a huge number of debug files. Some of these with a single entry like the above and some with 20 to 30 of them.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,282
    Plugin Contributions
    125

    Default Re: Lots of Debug files over and over.

    Please post the full debug log. Thanks!
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    629
    Plugin Contributions
    0

    Default Re: Lots of Debug files over and over.

    sorry, I meant to follow this up with the full log but I had to sanitize it first.

    Code:
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.
    
    [05-Apr-2025 07:31:40 America/Los_Angeles] Request URI: /admin/index.php?cmd=category_product_listing&cPath=70&page=5, IP address: 69.107.156.81, Language id 1
    #0 /includes/classes/products.php(81): zen_debug_error_handler()
    #1 /admin/category_product_listing.php(915): products->get_handler()
    #2 /admin/index.php(16): require('/home/host...')
    --> PHP Warning: Undefined array key "type_handler" in /includes/classes/products.php on line 81.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,335
    Plugin Contributions
    94

    Default Re: Lots of Debug files over and over.

    You appear to have an old version of /admin/category_product_listing.php since line 915 of the as-shipped zc210 version is highlighted below:
    Code:
    // reset page when page is unknown
                if ((empty($_GET['page']) || $_GET['page'] === 1) && !empty($_GET['pID'])) {
                  $check_page = $db->Execute($products_query_raw);
                  if ($check_page->RecordCount() > $max_results) {
                    $check_count = 0;
                    foreach ($check_page as $item) {
                      $check_count++;
                      if ((int)$item['products_id'] === (int)$_GET['pID']) {
                        break;
                      }
                    }
                    $_GET['page'] = round((($check_count / $max_results) + (fmod_round($check_count, $max_results) != 0 ? .5 : 0)));
                    $page = $_GET['page'];
                  } else {
                    $_GET['page'] = 1;
                  }
                }
                $products_split = new splitPageResults($_GET['page'], $max_results, $products_query_raw, $products_query_numrows);
                $products = $db->Execute($products_query_raw);
    Note, too, that /includes/classes/products.php, while still shipped in the distribution, is deprecated as of zc210 and no longer used within the core code.

  5. #5
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    629
    Plugin Contributions
    0

    Default Re: Lots of Debug files over and over.

    I just opened up my zipped file for ZC 2.01 and the copy of category_product_listing.php there is an exact match to what is on my server (using Winmerge to verify).

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,335
    Plugin Contributions
    94

    Default Re: Lots of Debug files over and over.

    Quote Originally Posted by g2ktcf View Post
    I just opened up my zipped file for ZC 2.01 and the copy of category_product_listing.php there is an exact match to what is on my server (using Winmerge to verify).
    That's why including the Zen Cart version being used is "helpful".

    It looks like one or more products have an unknown 'products_type' code. You can make the following change to work around that issue, updating /includes/classes/products.php:
    Code:
      function get_handler($type) {
        global $db;
    
        // this is a fallback safety to protect against damaged (inaccessible) data caused by incorrect code in custom product types
        if ((int)$type == 0) $type = 1;
    
        $sql = "select type_handler from " . TABLE_PRODUCT_TYPES . " where type_id = '" . (int)$type . "'";
        $handler = $db->Execute($sql);
        return ($handler->EOF) ? 'product_info' : $handler->fields['type_handler'];
      }

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,841
    Plugin Contributions
    11

    Default Re: Lots of Debug files over and over.

    Quote Originally Posted by lat9 View Post
    You appear to have an old version of /admin/category_product_listing.php since line 915 of the as-shipped zc210 version is highlighted below:

    Note, too, that /includes/classes/products.php, while still shipped in the distribution, is deprecated as of zc210 and no longer used within the core code.
    the OP stated zc201 and line 915 is as stated.

    and in looking at v201, this error seems to me to be a data issue. see this section of code.

    to me, it seems that your table product_types is missing some data. the products in category 70 have a product type that are missing from that table.

    as to whether the changes in v210 would account for this sort of data corruption, i can not say (ok, i probably could say, but i am not going to spend any time looking it up right now).

    so i would examine that data for any missing records. it seems that creating any missing records is something that needs to be done in mysql, as the admin function does not provide for it.

    see:

    https://docs.zen-cart.com/dev/code/product_types/

    best.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  8. #8
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    629
    Plugin Contributions
    0

    Default Re: Lots of Debug files over and over.

    Quote Originally Posted by carlwhat View Post
    the OP stated zc201 and line 915 is as stated.

    and in looking at v201, this error seems to me to be a data issue. see this section of code.

    to me, it seems that your table product_types is missing some data. the products in category 70 have a product type that are missing from that table.

    as to whether the changes in v210 would account for this sort of data corruption, i can not say (ok, i probably could say, but i am not going to spend any time looking it up right now).

    so i would examine that data for any missing records. it seems that creating any missing records is something that needs to be done in mysql, as the admin function does not provide for it.

    see:

    https://docs.zen-cart.com/dev/code/product_types/

    best.
    Thanks Carl. I THINK I know what the problem is. It appears to be an import error from my csv file using DBIO. I think I accidentally created "music products". Looking further. This could be a bit of a mess. I have no music in my store at all.

  9. #9
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    629
    Plugin Contributions
    0

    Default Re: Lots of Debug files over and over.

    Quote Originally Posted by g2ktcf View Post
    Thanks Carl. I THINK I know what the problem is. It appears to be an import error from my csv file using DBIO. I think I accidentally created "music products". Looking further. This could be a bit of a mess. I have no music in my store at all.
    oh yea...found it. Now I have to ask a question - How to fix it?

    I used DBIO to upload product_ID 442 up to 467 and instead of type 1 for "general", I got an auto complete for "types" 1,2,3,4, etc. So, can straight edit these in the db directly?? will it causes it major knockdown issues?

  10. #10
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    629
    Plugin Contributions
    0

    Default Re: Lots of Debug files over and over.

    Quote Originally Posted by g2ktcf View Post
    oh yea...found it. Now I have to ask a question - How to fix it?

    I used DBIO to upload product_ID 442 up to 467 and instead of type 1 for "general", I got an auto complete for "types" 1,2,3,4, etc. So, can straight edit these in the db directly?? will it causes it major knockdown issues?
    I backed everything up and directly edited the product_types to 1 for the entries. It APPPEARS to work...but I am a bit worried lol.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v155 tons of MYdebug logs created over and over
    By jasonshanks in forum General Questions
    Replies: 11
    Last Post: 1 Jan 2020, 08:25 AM
  2. v154 Have to log in over and over and over
    By jenpen in forum General Questions
    Replies: 8
    Last Post: 5 Apr 2018, 03:55 AM
  3. Cart keeps asking for login over and over
    By Ripper in forum General Questions
    Replies: 8
    Last Post: 10 Oct 2007, 04:09 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