diff --git a/TranslationForm/TranslationForm.php b/TranslationForm/TranslationForm.php index 50e11ea..f6c872c 100644 --- a/TranslationForm/TranslationForm.php +++ b/TranslationForm/TranslationForm.php @@ -145,18 +145,20 @@ public function guessMissingFieldOptions($guesser, $class, $property, $options) $options['field_type'] = $typeGuess->getType(); } - if (!isset($options['pattern']) && ($patternGuess = $guesser->guessPattern($class, $property))) { - $options['pattern'] = $patternGuess->getValue(); - } - if (Kernel::VERSION_ID > '20512') { if (!isset($options['attr']['maxlength']) && ($maxLengthGuess = $guesser->guessMaxLength($class, $property))) { $options['attr']['maxlength'] = $maxLengthGuess->getValue(); } + if (!isset($options['attr']['pattern']) && ($patternGuess = $guesser->guessPattern($class, $property))) { + $options['attr']['pattern'] = $patternGuess->getValue(); + } } else { if (!isset($options['max_length']) && ($maxLengthGuess = $guesser->guessMaxLength($class, $property))) { $options['max_length'] = $maxLengthGuess->getValue(); } + if (!isset($options['pattern']) && ($patternGuess = $guesser->guessPattern($class, $property))) { + $options['pattern'] = $patternGuess->getValue(); + } } return $options;