diff --git a/CHANGELOG.md b/CHANGELOG.md index e8fb31e..e182e1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ Types of changes > [!Tip] > Thank you to all [EAP](https://pdir.de/crowdfunding/social-feed-bundle.html) supporters! +## [2.14.0](https://github.com/pdir/social-feed-bundle/tree/2.14.0) - 2025-01-08 + +- [Added] Add compatibility for Contao 5.4+ +- [Fixed] Instagram import (You need a Business ?) + ## [2.13.6](https://github.com/pdir/social-feed-bundle/tree/2.13.6) - 2024-11-21 -[Fixed] Update kevinrob/guzzle-cache-middleware fix #150 🤗 [contaoacademy](https://github.com/contaoacademy) diff --git a/config/services.yml b/config/services.yml index 85fd45f..2da324f 100644 --- a/config/services.yml +++ b/config/services.yml @@ -47,10 +47,6 @@ services: Pdir\SocialFeedBundle\EventListener\DataContainer\SocialFeedListener: public: true - arguments: - - "@router" - - '@security.helper' - - '@contao.image.sizes' pdir_social_feed_moderate.controller: class: Pdir\SocialFeedBundle\Controller\ModerateController diff --git a/src/EventListener/DataContainer/SocialFeedListener.php b/src/EventListener/DataContainer/SocialFeedListener.php index 0b964e6..e71817b 100644 --- a/src/EventListener/DataContainer/SocialFeedListener.php +++ b/src/EventListener/DataContainer/SocialFeedListener.php @@ -30,34 +30,27 @@ use Pdir\SocialFeedBundle\EventListener\Config; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\RouterInterface; -use Symfony\Component\Security\Core\Security; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; class SocialFeedListener { public const SESSION_KEY = 'social-feed-id'; - /** - * @var RouterInterface - */ - private $router; - /** * @var SessionInterface */ private $session; - private Security $security; - private ImageSizes $imageSizes; - /** * ModuleListener constructor. */ - public function __construct(RouterInterface $router, Security $security, ImageSizes $imageSizes) + public function __construct( + private readonly RouterInterface $router, + private readonly TokenStorageInterface $tokenStorage, + private readonly ImageSizes $imageSizes + ) { - $this->router = $router; $this->session = System::getContainer()->get('request_stack')->getCurrentRequest()->getSession(); - $this->security = $security; - $this->imageSizes = $imageSizes; } /** @@ -92,7 +85,7 @@ public function onRequestTokenSave() */ public function getImageSizeOptions(): array { - $user = $this->security->getUser(); + $user = $this->tokenStorage->getToken()?->getUser(); if (!$user instanceof BackendUser) { return [];