Skip to content

Commit

Permalink
BUGFIX: Setting baseUri in form action uri
Browse files Browse the repository at this point in the history
  • Loading branch information
simstern committed Sep 4, 2019
1 parent 14347f6 commit 70e00b1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Classes/ViewHelpers/FormViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* source code.
*/

use Neos\Flow\Http\Request;
use Neos\Flow\Http\Uri;
use Neos\Flow\Mvc\ActionRequest;
use Neos\FluidAdaptor\ViewHelpers\FormViewHelper as FluidFormViewHelper;
use Neos\Form\Core\Runtime\FormRuntime;
Expand Down Expand Up @@ -58,8 +60,14 @@ protected function getFormObjectName()
protected function getFormActionUri()
{
/** @var ActionRequest $actionRequest */
$actionRequest = $this->controllerContext->getRequest();
$uri = $actionRequest->getHttpRequest()->getUri();
$actionRequest = clone $this->controllerContext->getRequest();
$requestUri = $actionRequest->getHttpRequest()->getUri();
/** @var Uri $uri */
$uri = $actionRequest->getHttpRequest()->getAttribute(Request::ATTRIBUTE_BASE_URI)
->withPath($requestUri->getPath())
->withQuery($requestUri->getQuery())
->withFragment($requestUri->getFragment());

if ($this->hasArgument('section')) {
$uri = preg_replace('/#.*$/', '', $uri) . '#' . $this->arguments['section'];
}
Expand Down

0 comments on commit 70e00b1

Please sign in to comment.