Review main Merged

93099[BUGFIX] Prevent unsupported casting with \DateTimeImmutable in label

Xavier Perseguers CR +2 V +2 Easy +5 −0 updated 03/06/26, 12:23

Commit message

BackendUtility::getRecordTitle() may be provided with a $row parameter
where some fields have been pre-processed and converted from their
internal raw type (e.g., Unix timestamp) to a \DateTimeImmutable
object. If that happens, the automatic casting to string to compute the
corresponding processed value to be used for the label will crash.
Therefor we first convert back to the raw, unprocessed, value.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 57

  1. Xavier Perseguers uploaded patch set 1 03/06/26, 09:29

  2. Xavier Perseguers uploaded patch set 2 03/06/26, 09:30

  3. core-ci voted on patch set 1 V +1 03/06/26, 10:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97473

  4. core-ci voted on patch set 2 V +1 03/06/26, 10:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97474

  5. Garvin Hicking commented on patch set 2 CR +1 V +1 03/06/26, 11:09

    Thanks, this works for me. I could reproduce this with a patch to the following styleguide file: ``` diff --git a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_1_child.php b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_1_child.php index 755187f38be..6faa7b83796 100644 --- a/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_1_child.php +++ b/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1n_inline_1_child.php @@ -3,7 +3,7 @@ return [ 'ctrl' => [ 'title' => 'Form engine - inline 1:n inline_1 foreign field child', - 'label' => 'input_1', + 'label' => 'input_date', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'delete' => 'deleted', @@ -84,12 +84,17 @@ return [ ], ], ], - + 'input_date' => [ + 'label' => 'input_date', + 'config' => [ + 'type' => 'datetime', + ], + ], ], 'types' => [ '0' => [ 'showitem' => ' - --div--;General, input_1, color_1, input_3, group_db_1, select_tree_1, + --div--;General, input_1, color_1, input_3, group_db_1, select_tree_1, input_date, --div--;meta, disable, sys_language_uid, l10n_parent, l10n_source, ', ], ```
  6. Georg Ringer voted on patch set 2 CR +2 V +2 03/06/26, 12:23

  7. Georg Ringer merged patch set 3 03/06/26, 12:23