Skip to content

Commit

Permalink
Merge branch '4.1' into 4
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 15, 2023
2 parents 42495b9 + 25f22c0 commit 20a2f5c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Control/ElementFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace DNADesign\ElementalUserForms\Control;

use DNADesign\Elemental\Models\BaseElement;
use DNADesign\Elemental\Controllers\ElementController;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
Expand Down Expand Up @@ -55,7 +56,11 @@ public function finished()
$user->finished();

$page = $this->getPage();
$controller = Injector::inst()->create($page->getControllerName(), $this->element->getPage());

while ($page instanceof BaseElement) {
$page = $page->getPage();
}
$controller = Injector::inst()->create($page->getControllerName(), $page->data());
$element = $this->element;

return $controller->customise([
Expand Down

0 comments on commit 20a2f5c

Please sign in to comment.