From bf3a1cc6c38bfeb375bb6d008ec379a7ce463418 Mon Sep 17 00:00:00 2001 From: Thibeau Fuhrer Date: Tue, 30 Jun 2026 14:20:46 +0200 Subject: [PATCH] [FIX] #47986 UI: update `Text` and `Textarea` default value These `UI\Component\Input\Field` components cannot handle `null` as default value. Their constraint for requirement and default operations rely on working with a string. Hence the default value is changed to an empty string (`""`). * Fix https://mantis.ilias.de/view.php?id=47986 --- .../UI/src/Implementation/Component/Input/Field/Text.php | 5 +++++ .../UI/src/Implementation/Component/Input/Field/Textarea.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/ILIAS/UI/src/Implementation/Component/Input/Field/Text.php b/components/ILIAS/UI/src/Implementation/Component/Input/Field/Text.php index 46c1e5a765a0..749e8dc3911e 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Input/Field/Text.php +++ b/components/ILIAS/UI/src/Implementation/Component/Input/Field/Text.php @@ -67,6 +67,11 @@ public function getMaxLength(): ?int return $this->max_length; } + public function withValue($value): self + { + return parent::withValue($value ?? ""); + } + /** * @inheritdoc */ diff --git a/components/ILIAS/UI/src/Implementation/Component/Input/Field/Textarea.php b/components/ILIAS/UI/src/Implementation/Component/Input/Field/Textarea.php index 9a9682c28352..2dbab9a14c46 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Input/Field/Textarea.php +++ b/components/ILIAS/UI/src/Implementation/Component/Input/Field/Textarea.php @@ -101,6 +101,11 @@ public function getMinLimit(): ?int return $this->min_limit; } + public function withValue($value): self + { + return parent::withValue($value ?? ""); + } + /** * @inheritdoc */