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;