Skip to content

Commit

Permalink
Merge branch 'master' into pimcore7
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed Nov 2, 2020
2 parents c157b63 + ac674f3 commit ecf0ed5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG-2.2.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Within 2.2

## 2.2.6
- Bugs:
- [Product] fix cloning of ProductUnitDefinitions and add test for it. (https://github.com/coreshop/CoreShop/pull/1502)
- [CoreBundle] interactive login: cart might not be available for several reasons, ignore exception and don't assign a cart (https://github.com/coreshop/CoreShop/pull/1500)

## 2.2.5
- Bugs:
- [OrderBundle] fix permission keys for order-creation (https://github.com/coreshop/CoreShop/pull/1474)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use CoreShop\Bundle\ThemeBundle\Service\ActiveThemeInterface;
use CoreShop\Bundle\ThemeBundle\Service\ThemeNotResolvedException;
use CoreShop\Bundle\ThemeBundle\Service\ThemeResolverInterface;
use Pimcore\Http\Request\Resolver\PimcoreContextResolver;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
Expand All @@ -25,22 +26,13 @@

final class ThemeRequestListener implements EventSubscriberInterface
{
/**
* @var ThemeResolverInterface
*/
private $pimcoreContext;
private $themeResolver;

/**
* @var ActiveThemeInterface
*/
private $activeTheme;

/**
* @param ThemeResolverInterface $themeResolver
* @param ActiveThemeInterface $activeTheme
*/
public function __construct(ThemeResolverInterface $themeResolver, ActiveThemeInterface $activeTheme)
public function __construct(PimcoreContextResolver $pimcoreContextResolver, ThemeResolverInterface $themeResolver, ActiveThemeInterface $activeTheme)
{
$this->pimcoreContext = $pimcoreContextResolver;
$this->themeResolver = $themeResolver;
$this->activeTheme = $activeTheme;
}
Expand All @@ -67,6 +59,10 @@ public function onKernelController(FilterControllerEvent $event)

protected function resolveTheme(KernelEvent $event)
{
if ($this->pimcoreContext->matchesPimcoreContext($event->getRequest(), PimcoreContextResolver::CONTEXT_ADMIN)) {
return;
}

if (!$event->isMasterRequest()) {
$exception = $event->getRequest()->get('exception', null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ services:

CoreShop\Bundle\ThemeBundle\EventListener\ThemeRequestListener:
arguments:
- '@Pimcore\Http\Request\Resolver\PimcoreContextResolver'
- '@coreshop.theme.resolver'
- '@CoreShop\Bundle\ThemeBundle\Service\ActiveThemeInterface'
tags:
Expand Down

0 comments on commit ecf0ed5

Please sign in to comment.