mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
minor #16715 [Admin] Fix resending order confirmation emails (Wojdylak)
This PR was merged into the 1.14 branch. Discussion ---------- | Q | A |-----------------|----- | Branch? | 1.14 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | #16703 | License | MIT Commits ------- [Admin] Fix resending order confirmation emails
This commit is contained in:
commit
f6a3f43620
2 changed files with 10 additions and 5 deletions
|
|
@ -100,7 +100,7 @@ final class ResendOrderConfirmationEmailAction
|
|||
->add('success', 'sylius.email.order_confirmation_resent')
|
||||
;
|
||||
|
||||
return $this->redirect($request);
|
||||
return $this->redirect($request, $order);
|
||||
}
|
||||
|
||||
private function sendConfirmationEmailOrDispatchResendOrderConfirmation(OrderInterface $order): void
|
||||
|
|
@ -112,13 +112,20 @@ final class ResendOrderConfirmationEmailAction
|
|||
}
|
||||
}
|
||||
|
||||
private function redirect(Request $request): RedirectResponse
|
||||
private function redirect(Request $request, OrderInterface $order): RedirectResponse
|
||||
{
|
||||
if (null === $this->router) {
|
||||
return new RedirectResponse($request->headers->get('referer'));
|
||||
}
|
||||
|
||||
$redirect = $request->attributes->get('_sylius', [])['redirect'] ?? 'referer';
|
||||
$redirect = $request->attributes->get('_sylius', [])['redirect'] ?? null;
|
||||
|
||||
if (null === $redirect || is_array($redirect)) {
|
||||
return new RedirectResponse($this->router->generate(
|
||||
$redirect['route'] ?? 'sylius_admin_order_show',
|
||||
$redirect['params'] ?? ['id' => $order->getId()],
|
||||
));
|
||||
}
|
||||
|
||||
return new RedirectResponse($this->router->generate($redirect));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,5 +150,3 @@ sylius_admin_order_resend_confirmation_email:
|
|||
methods: [GET]
|
||||
defaults:
|
||||
_controller: Sylius\Bundle\AdminBundle\Action\ResendOrderConfirmationEmailAction
|
||||
_sylius:
|
||||
redirect: sylius_admin_order_show
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue