Review main Merged

88282[BUGFIX] Handle missing file metadata in filelist

Oli Bartsch CR +2 V +2 Normal +99 −4 updated 04/15/25, 15:11

Commit message

Clicking on a file name in the Filelist
module now opens FormEngine with the
associated metadata record for that file.

If a sys_file does not yet have a
corresponding sys_file_metadata record,
FormEngine will now open in "new record"
mode. This prevents potential exceptions
and allows editors to create the missing
metadata record directly.

Additionally, a DataHandler hook ensures to
update the file index after a new metadata
record is created. This is also required
to properly set width / height values.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2539

Show 814 earlier messages
  1. Oli Bartsch uploaded patch set 1 02/19/25, 20:20

  2. Oli Bartsch updated the commit message in patch set 2 02/19/25, 20:25

  3. core-ci voted on patch set 1 V +1 02/19/25, 20:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74411

  4. core-ci voted on patch set 2 V +1 02/19/25, 20:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74413

  5. Oli Bartsch uploaded patch set 3 V +1 02/19/25, 21:35

  6. core-ci voted on patch set 3 V -1 02/19/25, 21:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74418

  7. Oli Bartsch uploaded patch set 4 V -1 02/19/25, 23:04

  8. core-ci voted on patch set 4 V -1 02/19/25, 23:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74423

  9. Oli Bartsch uploaded patch set 5 V -1 02/19/25, 23:29

  10. core-ci voted on patch set 5 V +1 02/19/25, 23:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74424

  11. Oli Bartsch uploaded patch set 6 V +1 02/20/25, 08:41

  12. core-ci voted on patch set 6 V +1 02/20/25, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74450

  13. Oli Bartsch uploaded patch set 7 V +1 02/20/25, 08:50

  14. Oli Bartsch uploaded patch set 8 02/20/25, 08:51

  1. Oli Bartsch rebased onto patch set 9 02/20/25, 08:57

  2. core-ci voted on patch set 7 V +1 02/20/25, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74451

  3. core-ci voted on patch set 8 V +1 02/20/25, 08:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74452

  4. core-ci voted on patch set 9 V +1 02/20/25, 09:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74453

  5. Oli Bartsch rebased onto patch set 10 V +1 02/20/25, 16:50

  6. core-ci voted on patch set 10 V +1 02/20/25, 16:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74473

  7. Oli Bartsch rebased onto patch set 11 V +1 02/28/25, 08:47

  8. core-ci voted on patch set 11 V +1 02/28/25, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74875

  9. Garvin Hicking commented on patch set 11 CR +1 V +1 02/28/25, 21:00

    I'm not sure how to get into a situation where sys_file_metadata was missing (probably CLI/manual imports?!), but if being in that situation, this patch can fix it 😄
  10. Christian Kuhn commented on patch set 11 03/02/25, 00:30

    hey. i played around with this a bit and i'm not sure if this is the best option: when i upload a file, reference it in a CE, and delete its sys_file_metadata row, while having a CE that references the image, the CE shows a "dimensions could not be determined" box. so we not only have the crash in filelist, but more errors when metadata is not there. usually, when a file is uploaded, a default-lang sys_file_metadata row is created automatically. if wonder if we could have some more central places that "just create" a default metadata row in case it misses, just like 'upload' does? this way we may be able to skip the JS routing and the DH hook, and could probably have minor dedicated code for this maybe in EditDocumentController and/or FormEngine data provider where the sys_file/sys_file_metadata stuff? do you think it makes sense to give this idea a shot to see if we could kill more birds with one stone?

    UpdateFileIndexEntry.php:80

    "not not" found
  11. Oli Bartsch uploaded patch set 12 CR +1 V +1 03/03/25, 10:33

  12. Oli Bartsch commented on patch set 12 03/03/25, 10:33

    Reply

    Thanks for your thought. I gave the patch some time also, however did not come up with a better solution. I actually don't want to make write operations "on the fly" in EditDocumentController or any data provider. This might lead to troubled as it is dependent on the current users permissions etc. Additionally, this will not solve the original issue, that an exception is thrown in the filelist on "editing non existent metadata".

    UpdateFileIndexEntry.php:80 Reply

    Done
  13. core-ci voted on patch set 12 V +1 03/03/25, 10:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75001

  14. Oli Bartsch uploaded patch set 13 V +1 04/15/25, 12:07

  15. core-ci voted on patch set 13 V +1 04/15/25, 12:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77751

  16. Andreas Kienast commented on patch set 13 CR -1 04/15/25, 12:35

    package-lock.json:1

    I guess `npm` was executed in the wrong directory?
  17. Andreas Kienast commented on patch set 13 04/15/25, 12:50

    on it
  18. Andreas Kienast uploaded patch set 14 CR -1 V +1 04/15/25, 13:27

  19. Andreas Kienast commented on patch set 14 CR +1 V +1 04/15/25, 13:28

    file-list.ts:93

    Will push a new patch on top that converts this to proper URL objects.

    package-lock.json:1 Reply

    Done
  20. core-ci voted on patch set 14 V +1 04/15/25, 13:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77761

  21. Stefan Bürk voted on patch set 14 CR +1 V +1 04/15/25, 13:41

  22. Andreas Kienast commented on patch set 14 04/15/25, 14:39

  23. Oli Bartsch voted on patch set 14 CR +2 V +2 04/15/25, 15:04

  24. Oli Bartsch commented on patch set 14 04/15/25, 15:04

    file-list.ts:93 Reply

    Acknowledged
  25. Oli Bartsch merged patch set 15 04/15/25, 15:11