Skip to content

Commit

Permalink
Revert "fix: fixed back button causing issues when using default ht…
Browse files Browse the repository at this point in the history
…ml validation"

This reverts commit a29da8c.
  • Loading branch information
gustavs-gutmanis committed Oct 3, 2022
1 parent 540d3e9 commit 306f27e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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']);
Expand All @@ -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;
Expand Down

0 comments on commit 306f27e

Please sign in to comment.