Results 1 to 10 of 14

Threaded View

  1. #1
    Join Date
    Feb 2009
    Posts
    46
    Plugin Contributions
    0

    Default strrpos() expects parameter 1 to be string, array given in functions_categories.php

    I just upgraded to 1.3.9h, my cache file suddenly filled up myDebug logs.
    What it says is
    [11-Feb-2011 05:29:24] PHP Warning: strrpos() expects parameter 1 to be string, array given in /EDITED/includes/functions/functions_categories.php on line 484
    Here are lines 477-514

    Code:
    // Get all products_id in a Category and its SubCategories
    // use as:
    // $my_products_id_list = array();
    // $my_products_id_list = zen_get_categories_products_list($categories_id)
      function zen_get_categories_products_list($categories_id, $include_deactivated = false, $include_child = true, $parent_category = '0', $display_limit = '') {
        global $db;
        global $categories_products_id_list;
     484   $childCatID = str_replace('_', '', substr($categories_id, strrpos($categories_id, '_')));
    
        $current_cPath = ($parent_category != '0' ? $parent_category . '_' : '') . $categories_id;
    
        $sql = "select p.products_id
                from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                where p.products_id = p2c.products_id
                and p2c.categories_id = '" . (int)$childCatID . "'" .
                ($include_deactivated ? " and p.products_status = 1" : "") .
                $display_limit;
    
        $products = $db->Execute($sql);
        while (!$products->EOF) {
          $categories_products_id_list[$products->fields['products_id']] = $current_cPath;
          $products->MoveNext();
        }
    
        if ($include_child) {
          $sql = "select categories_id from " . TABLE_CATEGORIES . "
                  where parent_id = '" . (int)$childCatID . "'";
    
          $childs = $db->Execute($sql);
          if ($childs->RecordCount() > 0 ) {
            while (!$childs->EOF) {
              zen_get_categories_products_list($childs->fields['categories_id'], $include_deactivated, $include_child, $current_cPath, $display_limit);
              $childs->MoveNext();
            }
          }
        }
        return $categories_products_id_list;
      }
    Any idea why this error is occuring?

    I upgraded from 1.3.8, by doing a new install with a new database, I then moved all my stuff into the new database, deleted my old files and moved the new files into their place and I kept the new data base. The only thing I've added afterwards is the Facebook open graph add on.

    Side note, I just put my site in down for Maintenance and I'm not getting any error logs
    Dan
    Last edited by kashyyyk; 11 Feb 2011 at 06:58 AM.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 6 Jun 2016, 02:37 AM
  2. PHP Warning: addslashes() expects parameter 1 to be string, array given
    By schoolboy in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 10 May 2013, 02:19 PM
  3. v139e PHP Warning: strlen() expects parameter 1 to be string, array given in
    By irishshopper in forum Basic Configuration
    Replies: 4
    Last Post: 7 Mar 2013, 08:06 PM
  4. v139h PHP Warning: strip_tags() expects parameter 1 to be string, array given
    By BlessIsaacola in forum General Questions
    Replies: 1
    Last Post: 6 Mar 2012, 01:32 PM
  5. v150 PHP Warning: strlen() expects parameter 1 to be string, array given
    By caffeitalia in forum General Questions
    Replies: 1
    Last Post: 1 Feb 2012, 03: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