Skip to content

Commit 35cbc29

Browse files
committed
Don't call Request::get() anymore
... as this method was removed in Symfony 8
1 parent 51f6f3a commit 35cbc29

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Form/FormFlow.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,10 @@ protected function getRequestedStepNumber() {
538538
case 'POST':
539539
return intval($request->request->get($this->getFormStepKey(), $defaultStepNumber));
540540
case 'GET':
541-
return $this->allowDynamicStepNavigation || $this->allowRedirectAfterSubmit ?
542-
intval($request->get($this->dynamicStepNavigationStepParameter, $defaultStepNumber)) :
543-
$defaultStepNumber;
541+
$result = $request->attributes->get($this->dynamicStepNavigationStepParameter, $request);
542+
$var = ($request !== $result) ? $result : $request->query->get($this->dynamicStepNavigationStepParameter, (string)$defaultStepNumber);
543+
544+
return ($this->allowDynamicStepNavigation || $this->allowRedirectAfterSubmit) ? (int)$var : $defaultStepNumber;
544545
}
545546

546547
return $defaultStepNumber;
@@ -625,7 +626,8 @@ protected function determineInstanceId() {
625626
$instanceId = null;
626627

627628
if ($this->allowDynamicStepNavigation || $this->allowRedirectAfterSubmit) {
628-
$instanceId = $request->get($this->getDynamicStepNavigationInstanceParameter());
629+
$requestData = in_array($request->getMethod(), ['POST', 'PUT'], true) ? $request->request : $request->query;
630+
$instanceId = $requestData->get($this->getDynamicStepNavigationInstanceParameter());
629631
}
630632

631633
if ($instanceId === null) {
@@ -652,7 +654,7 @@ protected function bindFlow() {
652654
$reset = true;
653655
}
654656

655-
if (in_array($request->getMethod(), ['POST', 'PUT'], true) && $request->get($this->getFormStepKey()) !== null && !$this->dataManager->exists($this)) {
657+
if (in_array($request->getMethod(), ['POST', 'PUT'], true) && $request->request->get($this->getFormStepKey()) !== null && !$this->dataManager->exists($this)) {
656658
// flow is expired, drop posted data and reset
657659
$request->request->replace();
658660
$reset = true;

0 commit comments

Comments
 (0)