From 582f926c08a5a4194ee101cce0742b932b117c29 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 16 Aug 2022 08:34:32 +0200 Subject: [PATCH] fix: restore page redirections existing in v2.12 --- setup.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup.php b/setup.php index cf8d993dd..0a2a60ce4 100644 --- a/setup.php +++ b/setup.php @@ -488,6 +488,21 @@ function plugin_formcreator_redirect() { Html::redirect($issue->getFormURLWithID($issue->getID()) . '&tickets_id=' . $itemTicket->fields['tickets_id']); } + + $pages = [ + 'front/reservationitem.php' => FORMCREATOR_ROOTDOC . '/front/reservationitem.php', + 'front/helpdesk.faq.php' => FORMCREATOR_ROOTDOC . '/front/wizard.php', + 'front/ticket.php' => FORMCREATOR_ROOTDOC . '/front/issue.php', + ]; + foreach ($pages as $srcPage => $dstPage) { + if (strpos($_SERVER['REQUEST_URI'], $srcPage) !== false && strpos($_SERVER['REQUEST_URI'], $dstPage) === false) { + if ($srcPage == 'front/reservationitem.php') { + $_SESSION['plugin_formcreator']['redirected']['POST'] = $_POST; + } + Html::redirect($dstPage); + break; + } + } } function plugin_formcreator_options() {