Skip to content
Snippets Groups Projects

F9221typeAhead_Zeichenlimite_ausschalten

Merged Carsten Rose requested to merge F9221typeAhead_Zeichenlimite_ausschalten into master
1 file
+ 12
7
Compare changes
  • Side-by-side
  • Inline
@@ -1092,13 +1092,13 @@ class Support {
$feMaxLength = false;
switch ($formElement[FE_TYPE]) {
case 'date':
case FE_TYPE_DATE:
$feMaxLength = 10;
break;
case 'datetime':
case FE_TYPE_DATETIME:
$feMaxLength = 19;
break;
case 'time':
case FE_TYPE_TIME:
$feMaxLength = 8;
break;
}
@@ -1108,18 +1108,23 @@ class Support {
$maxLength = $feMaxLength;
}
// In case the underlying table column is not of type date/time, the $maxLength might be too high: correct
// In case the underlying table column is not of type date/time, the respect user given value ($maxLength might be too high).
if ($feMaxLength !== false && $maxLength !== false && $feMaxLength < $maxLength) {
$maxLength = $feMaxLength;
}
// date/datetime
// Physical maxlength given?
if ($maxLength !== false) {
// Custom maxLength given?
if (isset($formElement[FE_MAX_LENGTH]) && is_numeric($formElement[FE_MAX_LENGTH]) && $formElement[FE_MAX_LENGTH] != 0) {
if ($formElement[FE_MAX_LENGTH] > $maxLength) {
$formElement[FE_MAX_LENGTH] = $maxLength;
// See #9221 - in case of typeahead (with key/value translation) the user should be capable to input longer text than column width.
if (!(isset($formElement[FE_TYPEAHEAD_LDAP]) || isset($formElement[FE_TYPEAHEAD_SQL]))) {
if ($formElement[FE_MAX_LENGTH] > $maxLength) {
$formElement[FE_MAX_LENGTH] = $maxLength;
}
}
} else {
// Take physical maxLength
$formElement[FE_MAX_LENGTH] = $maxLength;
}
}
Loading