Review main Abandoned

93794[BUGFIX] Recompute sys_file identifier hash on impexp import

Benjamin Kott CR -1 V +1 Normal +5 −55 updated 04/24/26, 11:55

Commit message

The schema-based record filtering introduced in #109119 strips
identifier_hash from exported sys_file records because the column
is not declared in the sys_file TCA. Import::writeSysFileRecords()
then fails to rebuild the md5(storage ':' identifier_hash) fileId
used to look up binary file content in the <files_fal> block,
emitting an "Undefined array key identifier_hash" warning and
leaving files unimported.

Compute the hash from the identifier field instead. identifier is
TCA-declared and survives filterRecordFields(), and sha1 of the
canonicalized identifier mirrors AbstractDriver::hashIdentifier(),
which the export already uses to key the <files_fal> entry. This
restores import of XML/T3D exports produced since #109119 without
requiring a re-export, and stays compatible with older exports
that happened to include identifier_hash in the record data.

Drop identifier_hash and folder_hash from the impexp XmlImports
test fixtures along the way: they are derived values from
identifier and had no reason to be carried. Two entries in
pages-and-ttcontent-with-two-images.xml carried copy-pasted wrong
hashes that happened to work only because the <files_fal> keys
used the same wrong hash; those keys are corrected to
md5(storage ':' sha1(identifier)) as part of the cleanup.

Review

  • Code review CR -1
    • Benjamin Kott -1
    • Benni Mack +1
  • Verified V +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 16

Review log 1013

  1. Benjamin Kott uploaded patch set 1 04/22/26, 07:19

  2. Benjamin Kott rebased onto patch set 2 04/22/26, 12:38

  3. core-ci voted on patch set 2 V +1 04/22/26, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100897

  4. Benjamin Kott rebased onto patch set 3 V +1 04/22/26, 22:20

  5. core-ci voted on patch set 3 V +1 04/22/26, 22:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100963

  6. Benjamin Kott updated the commit message in patch set 4 V +1 04/23/26, 05:52

  7. Benni Mack commented on patch set 4 04/23/26, 06:01

    Import.php:633

    should we adapt this in Export.php
  8. Benjamin Kott commented on patch set 4 04/23/26, 06:15

    Import.php:633 Reply

    this state does not include identifier_hash, it will be readded with the next, but its also there a computed value we could potentially drop, so prepping it here seems a good idea - but as mentioned not strictly nessesary with the second one
  9. core-ci voted on patch set 4 V +1 04/23/26, 06:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100986

  10. Benni Mack voted on patch set 4 CR +1 V +1 04/23/26, 08:27

  11. Benni Mack commented on patch set 4 04/24/26, 08:38

    Import.php:633 Reply

    Done
  12. Benjamin Kott commented on patch set 4 CR -1 04/24/26, 08:58

    Unresolved

    still discussing if nessesary or too risky
  13. Benjamin Kott abandoned the change 04/24/26, 11:55

    obsolete bugfix with https://review.typo3.org/c/Packages/TYPO3.CMS/+/93812 for now, also misses to respect driver hash generation of files