Skip to content

Commit

Permalink
fix(symfony): make WriteListener compatible with MainController
Browse files Browse the repository at this point in the history
While "data" is set in the context in the MainController, this was not the case with the WriteListener.

I noticed this after updating from v3.2.14 to v3.3.3. Although I had set `event_listeners_backward_compatibility_layer` to `false`, the Symfony events were used again instead of the `MainController`. I had to set `use_symfony_listeners` to false so that I could restore the behavior of v3.2.14.

Shouldn't `use_symfony_listeners` be `false` if `event_listeners_backward_compatibility_layer` is also set to `false`?
  • Loading branch information
ihmels authored and Yannick Ihmels committed May 23, 2024
1 parent e867d07 commit 0b004a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Symfony/EventListener/WriteListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function onKernelView(ViewEvent $event): void
'uri_variables' => $uriVariables,
'resource_class' => $operation->getClass(),
'previous_data' => false === $operation->canRead() ? null : $request->attributes->get('previous_data'),
'data' => false === $operation->canRead() ? null : $request->attributes->get('data'),
]);

if ($data) {
Expand Down

0 comments on commit 0b004a1

Please sign in to comment.