Skip to content

Fix category overview #3439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sniemetz
Copy link

@sniemetz sniemetz commented Apr 3, 2025

used wrong argument to build category tree

@thorsten thorsten self-assigned this Apr 4, 2025
@thorsten thorsten added the Bug label Apr 4, 2025
@thorsten thorsten added this to the 4.1 milestone Apr 4, 2025
@@ -59,8 +59,9 @@ public function index(Request $request): Response

$session = $this->container->get('session');
$categoryOrder = $this->container->get('phpmyfaq.category.order');
$orderedCategories = $categoryOrder->getAllCategories();
$categoryTree = $categoryOrder->getCategoryTree($orderedCategories);
$orderedCategories = $categoryOrder->getAllCategories();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -127,11 +127,11 @@ public function getCategoryTree(array $categories, int $parentId = 0): array

foreach ($categories as $category) {
if ((int) $category['parent_id'] === $parentId) {
$children = $this->getCategoryTree($categories, $category['category_id']);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks wrong, please also check the comment below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants