Issue Task Closed

#94192Make the DateTimeConverter error for PropertyMappings translatable

Bastian Stargazer 05/25/21, 10:05 updated 07/09/24, 12:45

Description

If a model holding a DateTime attribute and is filled by a form, currently the error-message for falsely entered values can not be translated because its hard-coded in Extbase’s DateTimeConverter.php:169 ( Validation\Error(‘The date “%s” was not recognized (for format “%s”).’, 1307719788, [$dateAsString, $dateFormat]) )

The PropertyMapping for this attribute is configured in an initializeAction(), like:


// set input date-format for mapping the user.birthday property
$this->arguments->getArgument('user')->getPropertyMappingConfiguration()
  ->forProperty('birthday')->setTypeConverterOption(
    DateTimeConverter::class,
    DateTimeConverter::CONFIGURATION_DATE_FORMAT,
    'd.m.Y'
);

Input of “test” into the birthday form field resulting in The date “test” was not recognized (for format “d.m.Y”). as non translatable, where as all other messages are in the right locale.

Reviews 1

Files 1

History 610

  1. Bastian Stargazer commented and changed attached extbase-no-translation-available.png 01/06/22, 11:36

    push – because its such a tiny change for a next release!

  2. Mathias Schreiber changed Sprint Focus Remote Sprint 03/08/22, 12:09

  3. Susanne Moog changed Sprint Focus Remote Sprint On Location Sprint 08/05/22, 13:00

  4. Oliver Hader changed Sprint Focus On Location Sprint 11/03/22, 09:04

  5. Gerrit Code Review pushed patch set 1 for main to change 81933 status New Under Review 11/23/23, 17:35

  6. Gerrit Code Review pushed patch set 2 for main to change 81933 11/23/23, 18:19

  7. Gerrit Code Review pushed patch set 3 for main to change 81933 06/24/24, 12:16

  8. Gerrit Code Review pushed patch set 4 for main to change 81933 06/25/24, 11:36

  9. Tim Weisenberger commented and changed status Under Review Resolved done 0 % 100 % 06/25/24, 12:10

    Applied in changeset commit:399bb327c649aab55aa868293959ac2d183c97c3.

  10. Benni Mack changed status Resolved Closed 07/09/24, 12:45