From 11ce218d094c00bc0c74965b66f5a01e4cefdd1b Mon Sep 17 00:00:00 2001 From: ppound Date: Wed, 8 Sep 2021 11:16:31 -0300 Subject: [PATCH] fixed issue where users were redirected to non existence page after deleting a reservation users now get sent back to front --- reservation.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reservation.inc b/reservation.inc index d33f793..45736a0 100644 --- a/reservation.inc +++ b/reservation.inc @@ -280,12 +280,18 @@ function reserve_form_reserve_reservation_delete_form_alter(array &$form, FormSt $year = reserve_which_year($month, $day); $yyyymmdd = date('Y-m-d', strtotime($year . '-' . $month . '-' . $day)); - $form['ebundle'] = ['#type' => 'hidden', '#value' => $ebundle]; $form['month'] = ['#type' => 'hidden', '#value' => date('m', strtotime($yyyymmdd))]; $form['day'] = ['#type' => 'hidden', '#value' => date('d', strtotime($yyyymmdd))]; + $form['actions']['submit']['#submit'][] = 'reserve_return_to_home_page'; +} - $form['actions']['submit']['#submit'][] = 'reserve_return_to_reservations_page'; +/** + * Custom submit handler for login form. + */ +function reserve_return_to_home_page($form, FormStateInterface $form_state) { + $url = Url::fromRoute(''); + $form_state->setRedirectUrl($url); } /**