Review main Merged

64841[BUGFIX] Fix serialization of FileReference objects

Benjamin Franzke CR +2 V +2 Normal +36 −19 updated 06/30/20, 18:01

Commit message

FileReferences objects contain references to File
objects which itself contain service dependencies
(e.g. event dispatcher) which are not seralizable.

This leads to problems for instance when having
a multi-step form containing file uploads where
file reference objects are being serialized.

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Oliver Hader +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Oliver Hader +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1114

  1. Benjamin Franzke uploaded patch set 1 06/08/20, 19:51

  2. TYPO3com voted on patch set 1 V +1 06/08/20, 20:04 Completed build in 13m 15s on Mon, 8 Jun, 08:04 PM Test Summary: 72800 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3890

  3. Oliver Hader voted on patch set 1 V +1 06/08/20, 22:54

  4. Oliver Hader commented on patch set 1 06/08/20, 22:58

    Thank, it fixes the form upload problem. Besides `FileReference` there are `File and `Folder` which have corresponding Extbase models and type converters. The current approach assumes that all properties have been stored (since those details are not part of the serialization anymore) - this is fine in general, but should be documented in some important RST file
  5. Oliver Hader commented on patch set 1 CR +1 06/08/20, 22:58

    > Patch Set 1: > > Thank, it fixes the form upload problem. > > Besides `FileReference` there are `File and `Folder` which have corresponding Extbase models and type converters. The current approach assumes that all properties have been stored (since those details are not part of the serialization anymore) - this is fine in general, but should be documented in some important RST file
  6. Oliver Klee commented on patch set 1 06/09/20, 13:53

    FileReference.php:96 Unresolved

    Do we know more about the type, e.g., int|string?

    FileReference.php:97 Unresolved

    This needs to be ResourceFactory|null, if I read the calling code correctly.

    FileReference.php:99 Unresolved

    @throws \RuntimeException

    FileReference.php:100 Unresolved

    Please let's have a type declaration ?ResourceFactory for $factory. As the method is not expected to be called with only one argument (at least for the time being), we can also drop the default value.

    FileReference.php:102 Unresolved

    to help static code analysis: if (!$factory instanceof ResourceFactory) {

    FileReference.php:106 Unresolved

    to help static code analysis: if (!$file instanceof FileInterface) {

    FileReference.php:537 Unresolved

    More specific: @return string[]
  7. Oliver Hader uploaded patch set 2 06/15/20, 09:30

  8. Oliver Hader commented on patch set 2 CR -1 06/15/20, 09:32

    Adjusted recent remarks... However, I'm wondering why the handling is not put closer to `ResourceStorage` (which currently contains EventDispatcher)...
  9. TYPO3com voted on patch set 2 V -1 06/15/20, 09:44 Completed build in 13m 44s on Mon, 15 Jun, 09:44 AM Test Summary: 72860 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3914

  10. Oliver Hader commented on patch set 3 06/15/20, 10:45

    Published edit on patch set 2.
  11. TYPO3com voted on patch set 3 V +1 06/15/20, 10:58 Completed build in 13m 11s on Mon, 15 Jun, 10:58 AM Test Summary: 72860 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3915

  12. Oliver Hader commented on patch set 3 V +1 CR +1 06/15/20, 11:00

    Let's go with this one for the time being... the whole FAL-related handling is chaotic, "models" contain caches etc which need more refactoring and proper factories prior to that.
  13. Daniel Goerz voted on patch set 3 V +2 CR +2 06/30/20, 18:01

  14. Daniel Goerz merged patch set 4 06/30/20, 18:01