Commit b7bdec08 authored by Gatterdam Patrick's avatar Gatterdam Patrick
Browse files

Merge branch 'fix/hide-inactive-categories' into 'master'

Respect property active of categories

See merge request shopware/plugins/RicoDynamicFAQ!28
parents 151a17aa da6ec84f
......@@ -97,11 +97,4 @@ js-lint:
- node-base
script:
- node_modules/eslint/bin/eslint.js .
php-cs:
stage: quality
image: ekreative/php-cs-fixer:2
dependencies:
- composer-base
script:
- php-cs-fixer fix --config=".php_cs" --format="json" --dry-run --allow-risky=yes .
#endregion
......@@ -2,23 +2,23 @@
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(__DIR__ . '/vendor/');
->exclude([__DIR__ . '/vendor/', __DIR__ . '/Controllers/']);
$header = <<<EOF
MIT License
Copyright (c) 2020 PSVneo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
......@@ -60,4 +60,4 @@ return PhpCsFixer\Config::create()
'general_phpdoc_annotation_remove' => ['annotations' => ["author", "package"]],
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
])
->setFinder($finder);
\ No newline at end of file
->setFinder($finder);
......@@ -61,7 +61,7 @@ class CategoryTree implements TreeBuilderInterface
public function build(...$args): array
{
$tree = [];
$topCategories = $this->getCategoryRepository()->findBy(['parent' => null]);
$topCategories = $this->getCategoryRepository()->findBy(['parent' => null, 'active' => true]);
/** @var Category $topCategory */
foreach ($topCategories as $topCategory) {
$this->buildTree($tree, $topCategory);
......
......@@ -49,7 +49,7 @@ class Shopware_Controllers_Frontend_RicoFaq extends \RicoDynamicFaq\Controllers\
$this->questionRepository->findBestScored($questionLimit)
),
'topCategories' => $this->translateCategories(
$this->categoryRepository->findBy(['parent' => null])
$this->categoryRepository->findBy(['parent' => null, 'active' => true])
),
'categoryQuestionTree' => $this->getQuestionTree()->build(),
]);
......
......@@ -3,7 +3,7 @@
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/5.3/engine/Shopware/Components/Plugin/schema/plugin.xsd">
<label lang="de">Dynamic FAQ</label>
<label>Dynamic FAQ</label>
<version>2.1.0</version>
<version>2.1.1</version>
<copyright>(c) PSVneo</copyright>
<license>MIT</license>
<link>https://git.riconnect.de/riconet-public/shopware/plugins/RicoDynamicFAQ</link>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment