Skip to content

Commit 05a4b64

Browse files
committed
process Closure expr the same way
1 parent 7bb89f4 commit 05a4b64

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Form/Control/Multiline.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,9 +771,7 @@ private function getExpressionValues(Model $entity): array
771771
{
772772
$dummyFields = $this->getExpressionFields($entity);
773773
foreach ($dummyFields as $k => $field) {
774-
if (!$field->expr instanceof \Closure) {
775-
$dummyFields[$k]->expr = $this->getDummyExpression($field, $entity);
776-
}
774+
$dummyFields[$k]->expr = $this->getDummyExpression($field, $entity);
777775
}
778776

779777
if ($dummyFields === []) {
@@ -830,6 +828,9 @@ private function getExpressionValues(Model $entity): array
830828
private function getDummyExpression(SqlExpressionField $exprField, Model $entity)
831829
{
832830
$expr = $exprField->expr;
831+
if ($expr instanceof \Closure) {
832+
$expr = $exprField->getDsqlExpression($entity->getModel()->expr(''));
833+
}
833834
if ($expr instanceof Persistence\Sql\Expression) {
834835
$expr = \Closure::bind(fn () => $expr->template, null, Persistence\Sql\Expression::class)();
835836
}

0 commit comments

Comments
 (0)