47871[BUGFIX] Improper usage of ProcessedFile
Commit message
Review
-
Code review CR 0
-
Verified V 0
Files 15
- typo3/sysext/backend/Classes/Backend/Avatar/DefaultAvatarProvider.php+7 −7
- typo3/sysext/backend/Classes/Clipboard/Clipboard.php+1 −1
- typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php+3 −1
- typo3/sysext/backend/Classes/Controller/File/FileController.php+1 −1
- typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php+2 −2
- typo3/sysext/backend/Classes/Form/Element/GroupElement.php+16 −4
- typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php+2 −2
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+15 −5
- typo3/sysext/core/Classes/Resource/Hook/FileInfoHook.php+12 −7
- typo3/sysext/core/Classes/Resource/Service/FileProcessingService.php+0 −1
- typo3/sysext/filelist/Classes/FileList.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+7 −2
- typo3/sysext/recordlist/Classes/Browser/FileBrowser.php+14 −13
- typo3/sysext/rtehtmlarea/Classes/ImageHandler/AddImageHandler.php+14 −13
- typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php+8 −3
Review log 8
-
Philipp Gampe uploaded patch set 1 04/23/16, 10:47
-
Susi Moog commented on patch set 1 CR +1 04/24/16, 10:15
+1 on reading, but how to test this? On windows, isProcessed always returns true, even if I disable all image processing and no thumbnails are generated... -
Philipp Gampe commented on patch set 1 04/24/16, 16:02
Well, let the image processing fail somehow ... this was just cleanup while working on another patch. The whole logic is a bit brocken and might need some extra cleanup (master only then). -
Susi Moog commented on patch set 1 04/25/16, 16:53
Yes of course I can let it fail by manipulating the code. But my question is actually what do we expect? If I disable image processing completely, do you still expect processing to be true or false? Because even though no thumbnails are generated processed returns true. Which seems counter intuitive and from what I understood from your commit message plain wrong. -
Philipp Gampe commented on patch set 1 04/25/16, 21:42
Well, once again we hit the conceptual documentation problem of FAL including completely broken behavior. This is what I expect: * process() always returns a valid ProcessedFile object * isProcessed() tells if the file was actually touched and a new processed file has been generated * the ProcessedFile object returns the original files properties in case of processing failures * all "normal" exceptions (e.g. missing write access) should be catched and only a "broken system" exception (e.g. neither IM nor GM are available) should bubble up * at some point "normal" exceptions should go and be replaced with explicit checks (e.g. have write access, otherwise do nothing and log a warning); they are mainly used as goto replacement inside FAL * all broken system exceptions should either fully halt the system (bubble up and stop execution) or have a definition of who is responsible to catch them and annotate them with @throws * the whole processing needs a service like approach to be used for other file types then just images (90% is already there) But first things first ... lets fix the current state such that it could be considered a sane and stable API. Considering the broken isProcessed() handling, I suggest to remove 7.6 from the releases line and only target master. The actual code for isProcessed() should be fixed by another patch. Going to bed now ... Zzzz -
Philipp Gampe commented on patch set 1 CR -2 04/25/16, 21:50
@Susi actually you are right and I misinterpreted the API * isProcessed() should be renamed to isAlreadyProcessed(), I fail to see the point of this method. * maybe even the process() method should be changed to getProcessedFile() * isUpdated() should be made public and be used throughout this patch * the current usage of isProcessed() in the core before this patch is wrong and needs fixing I will update this patch in the next days -
Philipp Gampe commented on patch set 1 07/08/16, 11:03
no update any time soon from me, whoever feels qualified may continue here :) -
Philipp Gampe abandoned the change 08/30/16, 21:19
needs a concept first