Skip to content

Commit

Permalink
Merge branch '4.0' into 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 15, 2023
2 parents 34aca8c + ee48cf9 commit 25f22c0
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 25f22c0

Please sign in to comment.