Skip to content

Commit

Permalink
Merge pull request #78 from somardigital/3.3-fix-issue-27
Browse files Browse the repository at this point in the history
update finished function, issue-27
  • Loading branch information
GuySartorelli authored Oct 13, 2023
2 parents cc74ea4 + 43427d7 commit 9fbe7be
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 9fbe7be

Please sign in to comment.