Skip to content

Commit 25503d1

Browse files
committed
save only id proper reference
1 parent fe1273c commit 25503d1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Form/Control/Multiline.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,14 @@ public function setInputValue(string $value): void
351351
}
352352
}
353353

354-
$ourEntity = $this->entityField->getField()->hasReference()
355-
? $this->entityField->getEntity()
356-
: $this->form->entity;
357-
$theirReference = $this->entityField->getField()->hasReference()
358-
? $this->entityField->getField()->getReference()
359-
: new \Atk4\Data\Reference('x'); // TODO
354+
$this->changes = $changes;
360355

361-
$changes->saveOnSave($ourEntity, $theirReference);
356+
if ($this->entityField->getField()->hasReference()) {
357+
$ourEntity = $this->entityField->getEntity();
358+
$theirReference = $this->entityField->getField()->getReference();
362359

363-
$this->changes = $changes;
360+
$changes->saveOnSave($ourEntity, $theirReference);
361+
}
364362
}
365363

366364
/**

0 commit comments

Comments
 (0)