Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    8
    Plugin Contributions
    0

    Default Debug files slowing server down

    Good morning,
    I was wondering if you can help me out with a problem in category select .php on my webshop www.japparts.nl

    My server is overloaded with debug files :

    [16-Aug-2019 23:28:29 Europe/Amsterdam] PHP Warning: Missing argument 5 for zen_get_categories_select(), called in /var/www/vhosts/japparts.nl/httpdocs/includes/functions/extra_functions/categories_select.php on line 38 and defined in /var/www/vhosts/japparts.nl/httpdocs/includes/functions/extra_functions/categories_select.php on line 11

    This is the php file

    <?php
    /**
    * @package languageDefines
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @copyright Portions Copyright 2006 Paul Mahot Haarlem the Netherlands
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: categories_select.php 2010-11-21 torvista $
    */

    function zen_get_categories_select($categories_array ='', $parent_id='', $parent_link = '', $indent = '', $show_subcategories) {
    //note any function argument defaults will never be used if passed '' from tpl_categories_select.php
    global $db;
    if (!is_array($categories_array)) $categories_array = array();

    $categories_query = "select c.parent_id, c.categories_id, cd.categories_name, c.categories_status
    from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
    where parent_id = '" . (int)$parent_id . "'
    and c.categories_id = cd.categories_id
    and c.categories_status=1
    and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    order by sort_order, cd.categories_name";

    $categories = $db->Execute($categories_query);

    while (!$categories->EOF) {
    $category_link = $parent_link . $categories->fields['categories_id'];
    if ($categories->fields['parent_id'] == '0') {
    $categories_array[] = array('id' => $categories->fields['categories_id'],
    'text' => $indent . $categories->fields['categories_name']);
    }
    else {
    $categories_array[] = array('id' => $category_link,
    'text' => $indent . $categories->fields['categories_name']);
    }

    if ($categories->fields['categories_id'] != $parent_id && $show_subcategories) {
    $categories_array = zen_get_categories_select($categories_array, $categories->fields['categories_id'], $category_link . '_', $indent . '&nbsp;&nbsp;');
    }

    $categories->MoveNext();
    }
    return $categories_array;
    }
    ?>

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Debug files slowing server down

    That fifth parameter needs a default value (since all previous parameters do). Change the following line
    Code:
    function zen_get_categories_select($categories_array ='', $parent_id='', $parent_link = '', $indent = '', $show_subcategories) {
    to read either
    Code:
    function zen_get_categories_select($categories_array ='', $parent_id='', $parent_link = '', $indent = '', $show_subcategories = true) {
    or
    Code:
    function zen_get_categories_select($categories_array ='', $parent_id='', $parent_link = '', $indent = '', $show_subcategories = false) {
    ... depending on whether the subcategories should or shouldn't, respectively, be displayed by default while you plan your upgrade from a version of Zen Cart that's coming up on its 7th birthday.

  3. #3
    Join Date
    Dec 2007
    Posts
    8
    Plugin Contributions
    0

    Default Re: Debug files slowing server down

    Great !!!

    That not only fixed the problem but also gave me the extra 1 sub category I had on my wishlist.

    Thanks a lot!

    Kind regards from Sunny Spain

    Henk Roukama

 

 

Similar Threads

  1. Show Debug Files Automatically
    By torvista in forum Addon Admin Tools
    Replies: 23
    Last Post: 22 Jun 2019, 04:12 PM
  2. v154 1000's of debug files generated slowing server down
    By vapeshopmeuk in forum General Questions
    Replies: 2
    Last Post: 18 Nov 2018, 09:08 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