Skip to content

Commit 251e520

Browse files
committed
Fix incompatibility with latest contao-content
1 parent a31ae70 commit 251e520

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
"menatwork/contao-multicolumnwizard-bundle": "^3.5",
4343
"symfony/config": "^5.4 || ^6.4",
4444
"symfony/dependency-injection": "^5.4 || ^6.4",
45-
"symfony/http-kernel": "^5.4 || ^6.4"
45+
"symfony/http-kernel": "^5.4 || ^6.4",
46+
"symfony/security-bundle": "^5.4 || ^6.4",
47+
"symfony/security-core": "^5.4 || ^6.4"
4648
},
4749
"require-dev": {
4850
"contao/manager-plugin": "^2.1",

src/EventListener/NavigationArticleListener.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Doctrine\DBAL\Connection;
1212
use Hofff\Contao\Content\Renderer\ArticleRenderer;
1313
use Hofff\Contao\Navigation\Event\ItemEvent;
14+
use Symfony\Bundle\SecurityBundle\Security;
15+
use Symfony\Component\Security\Core\Security as CoreSecurity;
1416

1517
use function array_map;
1618
use function array_unique;
@@ -28,6 +30,7 @@ public function __construct(
2830
private Connection $connection,
2931
private ContaoFramework $contaoFramework,
3032
private TokenChecker $tokenChecker,
33+
private Security|CoreSecurity $security,
3134
) {
3235
}
3336

@@ -56,7 +59,7 @@ public function __invoke(ItemEvent $event): void
5659
continue;
5760
}
5861

59-
$renderer = new ArticleRenderer($this->tokenChecker);
62+
$renderer = new ArticleRenderer($this->tokenChecker, $this->security);
6063
$renderer->setArticle($models[$article['article']]);
6164
$renderer->setRenderContainer((bool) $article['container']);
6265
$renderer->setExcludeFromSearch((bool) $article['nosearch']);

src/Resources/config/listener.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<argument type="service" id="database_connection" />
1212
<argument type="service" id="contao.framework" />
1313
<argument type="service" id="contao.security.token_checker"/>
14+
<argument type="service" id="security.helper"/>
1415
<tag name="kernel.event_listener" event="Hofff\Contao\Navigation\Event\ItemEvent"/>
1516
</service>
1617

0 commit comments

Comments
 (0)