Skip to content

Commit d2ade25

Browse files
committed
Use BuildViewEvent instead of CollectViewParametersEvent
1 parent 8fd3a1c commit d2ade25

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bundle/EventListener/Admin/CacheEnabledListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Netgen\Bundle\LayoutsIbexaBundle\EventListener\Admin;
66

7-
use Netgen\Layouts\Event\CollectViewParametersEvent;
7+
use Netgen\Layouts\Event\BuildViewEvent;
88
use Netgen\Layouts\Event\LayoutsEvents;
99
use Netgen\Layouts\HttpCache\ClientInterface;
1010
use Netgen\Layouts\HttpCache\NullClient;
@@ -31,7 +31,7 @@ public static function getSubscribedEvents(): array
3131
/**
3232
* Injects if the HTTP cache clearing is enabled or not.
3333
*/
34-
public function onBuildView(CollectViewParametersEvent $event): void
34+
public function onBuildView(BuildViewEvent $event): void
3535
{
3636
if (!$event->view instanceof LayoutViewInterface && !$event->view instanceof RuleViewInterface) {
3737
return;
@@ -41,7 +41,7 @@ public function onBuildView(CollectViewParametersEvent $event): void
4141
return;
4242
}
4343

44-
$event->addParameter(
44+
$event->view->addParameter(
4545
'http_cache_enabled',
4646
!$this->httpCacheClient instanceof NullClient,
4747
);

bundle/EventListener/Admin/IsEnterpriseVersionListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Netgen\Bundle\LayoutsIbexaBundle\EventListener\Admin;
66

7-
use Netgen\Layouts\Event\CollectViewParametersEvent;
7+
use Netgen\Layouts\Event\BuildViewEvent;
88
use Netgen\Layouts\Event\LayoutsEvents;
99
use Netgen\Layouts\View\View\LayoutViewInterface;
1010
use Netgen\Layouts\View\View\RuleViewInterface;
@@ -29,7 +29,7 @@ public static function getSubscribedEvents(): array
2929
/**
3030
* Injects if Netgen Layouts is the enterprise version or not.
3131
*/
32-
public function onBuildView(CollectViewParametersEvent $event): void
32+
public function onBuildView(BuildViewEvent $event): void
3333
{
3434
if (!$event->view instanceof LayoutViewInterface && !$event->view instanceof RuleViewInterface) {
3535
return;
@@ -39,6 +39,6 @@ public function onBuildView(CollectViewParametersEvent $event): void
3939
return;
4040
}
4141

42-
$event->addParameter('is_enterprise', $this->isEnterpriseVersion);
42+
$event->view->addParameter('is_enterprise', $this->isEnterpriseVersion);
4343
}
4444
}

0 commit comments

Comments
 (0)