Skip to content

Commit

Permalink
Merge branch 'redirectUrl' into 1.1.x
Browse files Browse the repository at this point in the history
[#25] Use `setRedirectUrl()` instead of route-based redirects
  • Loading branch information
jensschuppe committed May 16, 2024
2 parents 61c032a + b7b5d02 commit ec43395
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions modules/civiremote_event/src/Form/RegisterForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1212,11 +1212,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
/* @var Url $url */
$url = Drupal::service('path.validator')
->getUrlIfValid($config->get('form_redirect_route'));
$form_state->setRedirect(
$url->getRouteName(),
$url->getRouteParameters(),
$url->getOptions()
);
$form_state->setRedirectUrl($url);
}
}
catch (Exception $exception) {
Expand Down
6 changes: 1 addition & 5 deletions modules/civiremote_event/src/Form/RegistrationCancelForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
/* @var Url $url */
$url = Drupal::service('path.validator')
->getUrlIfValid($config->get('form_redirect_route'));
$form_state->setRedirect(
$url->getRouteName(),
$url->getRouteParameters(),
$url->getOptions()
);
$form_state->setRedirectUrl($url);
}

/**
Expand Down
6 changes: 1 addition & 5 deletions modules/civiremote_event/src/Form/RegistrationUpdateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
/* @var Url $url */
$url = Drupal::service('path.validator')
->getUrlIfValid($config->get('form_redirect_route'));
$form_state->setRedirect(
$url->getRouteName(),
$url->getRouteParameters(),
$url->getOptions()
);
$form_state->setRedirectUrl($url);
}
}
catch (Exception $exception) {
Expand Down

0 comments on commit ec43395

Please sign in to comment.