From 1363010a8c23409a207a6ecaaef05ab3b75c865f Mon Sep 17 00:00:00 2001 From: Rasmus Fuhse Date: Thu, 10 Jul 2025 07:50:52 +0000 Subject: =?UTF-8?q?Resolve=20"Wiki:=20Vorbelegung=20"keine"=20bei=20"?= =?UTF-8?q?=C3=9Cbergeordnete=20Seite"=20funktioniert=20nicht"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #5277 Merge request studip/studip!4336 (cherry picked from commit 73a016f48fa1882b5513f35ac729f7b22dc957ae) 9d8461fb re #5277 : cast to string so that select inputs show the '' option. bc06e2d8 remove image Co-authored-by: Rasmus Fuhse --- lib/classes/forms/Form.php | 2 +- lib/classes/forms/SelectInput.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classes/forms/Form.php b/lib/classes/forms/Form.php index fbedc1f..9d75fb8 100644 --- a/lib/classes/forms/Form.php +++ b/lib/classes/forms/Form.php @@ -134,7 +134,7 @@ class Form extends Part || $object->isAdditionalField($fieldname) || $object->isAliasField($fieldname) ) { - $params['fields'][$fieldname]['value'] = $object[$fieldname]; + $params['fields'][$fieldname]['value'] = (string) $object[$fieldname]; } } } diff --git a/lib/classes/forms/SelectInput.php b/lib/classes/forms/SelectInput.php index 0ba83c9..36850a9 100644 --- a/lib/classes/forms/SelectInput.php +++ b/lib/classes/forms/SelectInput.php @@ -11,7 +11,7 @@ class SelectInput extends Input $template = $GLOBALS['template_factory']->open('forms/select_input'); $template->title = $this->title; $template->name = $this->name; - $template->value = $this->value; + $template->value = (string) $this->value; $template->id = md5(uniqid()); $template->required = $this->required; $template->attributes = arrayToHtmlAttributes($this->attributes); -- cgit v1.0