Skip to content

Commit

Permalink
Reset the state of the service
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 24, 2024
1 parent 62d3de8 commit d003e2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Event/RequestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Contracts\Service\ResetInterface;

class RequestListener
class RequestListener implements ResetInterface
{
/**
* @var BuilderInterface
Expand Down Expand Up @@ -127,4 +128,9 @@ public function onKernelResponse(ResponseEvent $event): void
$event->setResponse($response);
}
}

public function reset(): void
{
$this->invalidSubmittedForm = false;
}
}
1 change: 1 addition & 0 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@

<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" />
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" />
<tag name="kernel.reset" />
</service>

<!-- List Builder -->
Expand Down

0 comments on commit d003e2f

Please sign in to comment.