diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-10-01 20:00:35 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-10-01 20:00:35 +0200 |
| commit | 0774229127611af4074d1d13fb3b72e1fff4264c (patch) | |
| tree | 476b81717aea85b15e9b3b1c58158ad4a3364a66 | |
| parent | 91eca6dc2211763270dc8d81f9456e0ae25141dc (diff) | |
i18n: don't set required attribute on other languages input, fixes #5912
Closes #5912
Merge request studip/studip!4509
| -rw-r--r-- | templates/i18n/input.php | 12 | ||||
| -rw-r--r-- | templates/i18n/textarea.php | 12 |
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 |
