Skip to content

Commit

Permalink
fix nested fieldlist id
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed May 10, 2023
1 parent edb80fb commit 21c0501
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/PureModalAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace LeKoala\PureModal;

use SilverStripe\Control\Controller;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\FieldList;
use SilverStripe\Control\Controller;
use SilverStripe\Forms\DatalessField;

/**
Expand Down Expand Up @@ -237,6 +238,23 @@ public function setFieldList(FieldList $fieldList)
return $this;
}

/**
* Make sure our nested fieldlist is bound to form
*
* @param Form $form
* @return $this
*/
public function setForm($form)
{
//@link https://github.com/unclecheese/silverstripe-display-logic/pull/155#issuecomment-1540966157
if ($this->fieldList) {
foreach ($this->fieldList as $field) {
$field->setForm($form);
}
}
return parent::setForm($form);
}

/**
* Get the dropUp value
* Called by ActionsGridFieldItemRequest to determine placement
Expand Down

0 comments on commit 21c0501

Please sign in to comment.