diff --git a/src/Form/Control/Dropdown.php b/src/Form/Control/Dropdown.php index 784e17e79c..62e1c6283c 100644 --- a/src/Form/Control/Dropdown.php +++ b/src/Form/Control/Dropdown.php @@ -276,8 +276,8 @@ protected function _addCallBackRow($row, $key = null): void $res = ($this->renderRowFunction)($row); $this->_tItem->set('value', $this->getApp()->uiPersistence->typecastSaveField($this->model->getField($this->model->idField), $row->getId())); } else { - $res = ($this->renderRowFunction)($row, $key); - $this->_tItem->set('value', (string) $res['value']); + $res = ($this->renderRowFunction)($row, $key); // @phpstan-ignore-line https://github.com/phpstan/phpstan/issues/10283#issuecomment-1850438891 + $this->_tItem->set('value', (string) $res['value']); // @phpstan-ignore-line https://github.com/phpstan/phpstan/issues/10283 } $this->_tItem->set('title', $res['title']); diff --git a/src/Form/Control/DropdownCascade.php b/src/Form/Control/DropdownCascade.php index 0e782ec8cd..4d0f08fc4b 100644 --- a/src/Form/Control/DropdownCascade.php +++ b/src/Form/Control/DropdownCascade.php @@ -87,7 +87,7 @@ public function getNewValues($id): array if ($this->renderRowFunction) { $res = ($this->renderRowFunction)($row); $values[] = [ - 'value' => $res['value'], + 'value' => $this->getApp()->uiPersistence->typecastSaveField($model->getField($model->idField), $row->getId()), 'text' => $res['title'], 'name' => $res['title'], ]; @@ -108,7 +108,7 @@ public function getNewValues($id): array * of possible values. * * @param list $values - * @param mixed $value the current field value + * @param mixed $value the current field value */ private function getJsValues(array $values, $value): array {