Advertisement:

Author Topic: OSClass 2.3.rc - Possible error  (Read 2079 times)

secondstrade

  • Full Member
  • ***
  • Posts: 110
OSClass 2.3.rc - Possible error
« on: November 09, 2011, 01:29:15 pm »
Hi,
I have installed OSclass 2.3.rc locally, and installed fine. Everything was ok as I was testing, except one.
I User Heirarchy theme, I Click on "See all Offers" in the home page below the latest items (5 Items) and it gives an error at the next page.  Error is as follows

PHP Warning:  array_reverse() expects parameter 1 to be array, null given in C:\Inetpub\wwwroot\oc-includes\osclass\model\Category.php on line 353
PHP Warning:  Invalid argument supplied for foreach() in C:\Inetpub\wwwroot\oc-content\themes\hierarchy\functions.php on line 69

I checked the Category.php line 69, it is as below.

/**
         * Same as toRootTree but reverse the results
         *
         * @access public
         * @since unknown
         * @param integer$category_id
         * @return array
         */
        public function hierarchy($category_id) {
            return array_reverse($this->toRootTree($category_id));
        }

I have checked the Category.php before upgrade, this line was not found. 

So anyone please let me know, is the new installation which caused this issue or is it my system issue. 

Thanks in advance

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: OSClass 2.3.rc - Possible error
« Reply #1 on: November 09, 2011, 06:25:48 pm »
Hi secondstrade,

Could you change line 297 of model/Category.php from


$tree 
null;


to


$tree 
= array();



Hope that worked ;)

secondstrade

  • Full Member
  • ***
  • Posts: 110
Re: OSClass 2.3.rc - Possible error
« Reply #2 on: November 10, 2011, 11:36:55 am »
Yes that did the magic.. Thanks a lot _CONEJO