1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed return missing in Language Model

Discussion in 'Resolved Bug Reports' started by ragtek, Aug 8, 2011.

  1. ragtek

    ragtek Guest

    method _getAllChildLanguageIds doesn't return anything, if the language have child ids

    It's not used anywhere (The method is used in getAllChildLanguageIds which isn't called in xf) but i wanted to use it for my add-on

    PHP:
        protected function _getAllChildLanguageIds($parentId, array $languageTree)
        {
            if (!isset(
    $languageTree[$parentId]))
            {
                return array();
            }

            
    $children = array();
            foreach (
    $languageTree[$parentId] AS $childId)
            {
                
    $children[] = $childId;
                
    $children array_merge($children$this->_getAllChildLanguageIds($childId$languageTree));
            }
        }
    should be
    PHP:
        protected function _getAllChildLanguageIds($parentId, array $languageTree)
        {
            if (!isset(
    $languageTree[$parentId]))
            {
                return array();
            }

            
    $children = array();
            foreach (
    $languageTree[$parentId] AS $childId)
            {
                
    $children[] = $childId;
                
    $children array_merge($children$this->_getAllChildLanguageIds($childId$languageTree));
            }
            return 
    $children;
        }
     

    Attached Files:

    Alluidh likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    That's a bit stupid. Fixed, thanks. :)
     

Share This Page