Skip to content

Commit

Permalink
Merge branch '3' into 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 28, 2023
2 parents 9dff501 + c59b93b commit 65f2c18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/Control/ElementFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ public function finished()
*/
public function Link($action = null)
{
$id = $this->element->ID;
$segment = Controller::join_links('element', $id, $action);
$page = Director::get_current_page();
$id = $this->element->ID;

if ($this->getAction() === 'finished'
&& $action !== 'finished'
&& $this->getRequest()->param('ID') == $id
) {
$segment = $action;
} else {
$segment = Controller::join_links('element', $id, $action);
}

if ($page && !($page instanceof ElementController)) {
return $page->Link($segment);
Expand Down
5 changes: 3 additions & 2 deletions src/Model/ElementForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ public function Form()
{
$controller = UserDefinedFormController::create($this);
$current = Controller::curr();
$controller->setRequest($current->getRequest());
$request = $current->getRequest();
$controller->setRequest($request);

if ($current && $current->getAction() == 'finished') {
if ($current && $current->getAction() == 'finished' && $request->param('ID') == $this->ID) {
return $controller->renderWith(UserDefinedFormController::class .'_ReceivedFormSubmission');
}

Expand Down

0 comments on commit 65f2c18

Please sign in to comment.