aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-10-01 20:00:35 +0200
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-10-01 20:00:35 +0200
commit0774229127611af4074d1d13fb3b72e1fff4264c (patch)
tree476b81717aea85b15e9b3b1c58158ad4a3364a66 /templates
parent91eca6dc2211763270dc8d81f9456e0ae25141dc (diff)
i18n: don't set required attribute on other languages input, fixes #5912
Closes #5912 Merge request studip/studip!4509
Diffstat (limited to 'templates')
-rw-r--r--templates/i18n/input.php12
-rw-r--r--templates/i18n/textarea.php12
2 files changed, 8 insertions, 16 deletions
diff --git a/templates/i18n/input.php b/templates/i18n/input.php
index 3ab92a5..adb6d61 100644
--- a/templates/i18n/input.php
+++ b/templates/i18n/input.php
@@ -18,14 +18,10 @@
$attr['name'] = "{$name}_i18n[{$locale}]";
$attr['value'] = $value->translation($locale);
- if (isset($attr['id'])) {
- unset($attr['id']);
- }
-
- // Remove required attribute if no text has been set
- if (isset($attr['required']) && !$attr['value']) {
- unset($attr['required']);
- }
+ unset(
+ $attr['id'],
+ $attr['required']
+ );
}
// If special attribute locale_names is defined, use name from that
diff --git a/templates/i18n/textarea.php b/templates/i18n/textarea.php
index 6d3dff8..a9e8715 100644
--- a/templates/i18n/textarea.php
+++ b/templates/i18n/textarea.php
@@ -8,14 +8,10 @@
$attr['name'] = "{$name}_i18n[{$locale}]";
$text = $value->translation($locale);
- if (isset($attr['id'])) {
- unset($attr['id']);
- }
-
- // Remove required attribute if no text has been set
- if (isset($attr['required']) && empty($attr['value'])) {
- unset($attr['required']);
- }
+ unset(
+ $attr['id'],
+ $attr['required']
+ );
}
// If special attribute locale_names is defined, use name from that