From 306f27eeb9bedaad49580c6a4a8b6129e869879e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavs=20G=C5=ABtmanis?= Date: Wed, 28 Sep 2022 12:13:24 +0300 Subject: [PATCH] Revert "fix: fixed `back` button causing issues when using default html validation" This reverts commit a29da8c6d7368a9c024d3293d6fd57e77387e180. --- .../plugin/src/Bundles/Form/Context/Pages/PageContext.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/plugin/src/Bundles/Form/Context/Pages/PageContext.php b/packages/plugin/src/Bundles/Form/Context/Pages/PageContext.php index cd54177f3..52eea6402 100644 --- a/packages/plugin/src/Bundles/Form/Context/Pages/PageContext.php +++ b/packages/plugin/src/Bundles/Form/Context/Pages/PageContext.php @@ -6,6 +6,7 @@ use Solspace\Freeform\Events\Forms\HandleRequestEvent; use Solspace\Freeform\Events\Forms\ResetEvent; use Solspace\Freeform\Events\Forms\ValidationEvent; +use Solspace\Freeform\Fields\SubmitField; use Solspace\Freeform\Form\Bags\PropertyBag; use Solspace\Freeform\Freeform; use Solspace\Freeform\Library\Composer\Components\Form; @@ -14,8 +15,6 @@ class PageContext { - public const KEY_ACTION_BACK = 'back'; - public function __construct() { Event::on(Form::class, Form::EVENT_BEFORE_VALIDATE, [$this, 'onValidate']); @@ -42,7 +41,7 @@ public function handleNavigateBack(HandleRequestEvent $event) return; } - $shouldWalkBack = self::KEY_ACTION_BACK === RequestHelper::post(Form::ACTION_KEY); + $shouldWalkBack = null !== RequestHelper::post(SubmitField::PREVIOUS_PAGE_INPUT_NAME); if ($shouldWalkBack) { $pageHistory = $bag->get(Form::PROPERTY_PAGE_HISTORY, []); $index = array_pop($pageHistory) ?? 0;