Skip to content

Commit

Permalink
fix tryLoad for MultiLine demo add & save
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Aug 19, 2022
1 parent 79c5f61 commit 4921ab1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form/Control/Multiline.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public function saveRows(): self
$currentIds = array_column($model->export(), $model->idField);

foreach ($this->rowData as $row) {
$entity = $model->tryLoad($row[$model->idField] ?? null);
$entity = $row[$model->idField] !== null ? $model->load($row[$model->idField]) : $model->createEntity();
foreach ($row as $fieldName => $value) {
if ($fieldName === '__atkml') {
continue;
Expand Down

0 comments on commit 4921ab1

Please sign in to comment.