CategoryTree return no data

RisteDimitrievski

Active member
Affected version
2.2.12
method getViewableCategories() function return no Categories data but these categories already exists.

PHP:
use XF\ControllerPlugin\AbstractCategoryTree;
use XF\Mvc\ParameterBag;

class CategoryTree extends AbstractCategoryTree
{
    protected $viewFormatter = 'downloadsystem\XF:Category\%s';
    protected $templateFormatter = 'xf_rd_downloadsystem_category_%s';
    protected $routePrefix = 'download-system/categories';
    protected $entityIdentifier = 'downloadsystem\XF:Category';
    protected $primaryKey = 'category_id';
    public function getCategoriesListData()
    {
        $categoryRepo = $this->getCategoryRepo();
        $categories = $categoryRepo->getViewableCategories();
        $categoryTree = $categoryRepo->createCategoryTree($categories);
        $categoryExtra = $categoryRepo->getCategoryListExtras($categoryTree);
        return [
            'categories' => $categories,
            'categoryTree' => $categoryTree,
            'categoryExtras' => $categoryExtra
        ];
    }
}
 
Top Bottom