Review main Merged

40508[FEATURE] Introduce Data Processor for Files

Benni Mack CR +2 V +2 Hard +598 −225 updated 07/10/15, 06:38

Commit message

In order to use real file objects within Fluid templates or other
places with cObjects, a new data processor for Files is added.

As it does most of the same part (collecting files from various
sources) as the FILES cObject, the logic has been separated
into an own class, the so-called "File Collector".

Review

  • Code review CR +2
    • Andreas Kienast +2
    • Wouter Wolters +1
    • Frans Saris +1
  • Verified V +2
    • Andreas Kienast +2
    • Wouter Wolters +1
    • Frans Saris +1

Issues 1

Files 5

Review log 35

Show 10 earlier messages
  1. Benni Mack uploaded patch set 1 06/21/15, 13:45

  2. Sascha Egerer commented on patch set 1 CR -1 06/26/15, 06:37

    Is it save to remove all these public function from the FilesContentObject? Shouldn't they get deprecated first? Is there a reason why not to add `array` as type for function parameters that must be of type array? I would add them in all these functions.

    FilesContentObject.php:43

    move that line down to line 72

    FilesProcessor.php:53

    Move that line into the if condition and change the condition to !empty($processorConfiguration['references.'])

    FilesProcessor.php:90

    Check if key exists before using it?

    FilesProcessor.php:97

    That should reuslt in a syntax error?!

    FileCollector.php:184

    be consistent and add @return void

    FileCollector.php:246

    Add type to $file parameter

    FileCollector.php:262

    add empty line above @return and change array to FileInterface[]
  3. Sascha Egerer commented on patch set 1 06/26/15, 06:39

    And Unit tests must be adjusted... but yes - patch is WIP.
  4. Patrick Broens commented on patch set 1 CR -1 06/26/15, 10:03

    FilesProcessor.php:58

    There is no variable $referenceField, probably should be $relationField

    FilesProcessor.php:68

    Typo: This should be 'files'
  5. Sascha Egerer uploaded patch set 2 06/26/15, 15:49

  6. Sascha Egerer commented on patch set 1 CR +1 06/26/15, 15:55

    FilesContentObject.php:43 Reply

    Done

    FilesProcessor.php:53 Reply

    Done

    FilesProcessor.php:58 Reply

    Done

    FilesProcessor.php:61

    $collections does also not exist

    FilesProcessor.php:68 Reply

    Done

    FilesProcessor.php:90 Reply

    Done

    FileCollector.php:184 Reply

    Done

    FileCollector.php:246 Reply

    Done

    FileCollector.php:262 Reply

    Done
  7. Benni Mack uploaded patch set 3 07/07/15, 05:48

  8. Nicole Hummel commented on patch set 3 V -1 07/07/15, 06:14

  9. Frans Saris uploaded patch set 4 07/07/15, 10:39

  10. Andreas Kienast commented on patch set 4 CR -1 07/07/15, 10:58

  1. Frans Saris commented on patch set 4 CR -1 07/07/15, 11:31

    I'm working on it
  2. Frans Saris uploaded patch set 5 07/07/15, 12:04

  3. Frans Saris uploaded patch set 6 07/07/15, 12:14

  4. Frans Saris voted on patch set 6 CR +1 V +1 07/07/15, 12:15

  5. Wouter Wolters commented on patch set 6 CR -1 07/07/15, 12:31

    FilesContentObject.php:88

    missing type

    FilesContentObject.php:159

    @param FileCollector $fileCollector

    FilesContentObject.php:162

    typehint?

    FileCollector.php:226

    one tab extra

    FileCollector.php:230

    here too
  6. Frans Saris commented on patch set 6 07/07/15, 14:50

    FilesContentObject.php:88 Reply

    Done

    FilesContentObject.php:159 Reply

    Done

    FilesContentObject.php:162 Reply

    Done

    FileCollector.php:226 Reply

    Done
  7. Frans Saris uploaded patch set 7 07/07/15, 14:50

  8. Benni Mack uploaded patch set 8 07/07/15, 16:12

  9. Benni Mack voted on patch set 8 CR +1 V +1 07/07/15, 16:12

  10. Frans Saris voted on patch set 8 CR +1 V +1 07/07/15, 16:15

  11. Benni Mack voted on patch set 8 CR 0 V 0 07/07/15, 16:21

  12. Benni Mack commented on patch set 8 CR +1 V +1 07/07/15, 16:22

    one more reviewer please, as Frans and me did this patch together.
  13. Wouter Wolters commented on patch set 8 07/07/15, 17:39

    Sorry, spotted one more improvement here

    FilesContentObject.php:42

    we can count this once and use it in both cases count($fileObjects)
  14. Wouter Wolters uploaded patch set 9 07/07/15, 21:22

  15. Wouter Wolters voted on patch set 9 V +1 CR +1 07/07/15, 21:22

  16. Frans Saris voted on patch set 9 CR +1 V +1 07/08/15, 05:45

  17. Andreas Kienast voted on patch set 9 CR +1 07/08/15, 06:30

  18. Andreas Kienast voted on patch set 9 CR +2 V +2 07/08/15, 06:39

  19. Andreas Kienast merged patch set 9 07/08/15, 06:39

  20. Sascha Egerer commented on patch set 9 07/08/15, 07:01

    Feature-67662-DataProcessorForFiles.rst:22

    I would change that to the nested syntax as this is better understandable. Ok for you? tt_content.image.20 { ... }

    Feature-67662-DataProcessorForFiles.rst:38

    Can't we use nested syntax here instead of comma seperated list? tt_content.image.20.dataProcessing.10.folders { 10 = 1:introduction/images/ 20 = 1:introduction/posters/ }

    Feature-67662-DataProcessorForFiles.rst:40

    new & last line

    Feature-67662-DataProcessorForFiles.rst:44

    line break as above

    Feature-67662-DataProcessorForFiles.rst:48

    not defined

    FilesContentObject.php:35

    force array by adding type infront of $conf?

    FileCollector.php:69

    force array type

    FileCollector.php:70

    we don't need that empty statement.

    FileCollector.php:112

    same as above.

    FileCollector.php:127

    same as above

    FileCollector.php:141

    same as above

    FileCollector.php:168

    same as above

    FileCollector.php:181

    $folderIentifier != '' as a $folderIdentifier with value 0 would fail here, right?

    FileCollector.php:185

    we don't need the $files variable here

    FileCollector.php:208

    do we really need the @?

    FileCollector.php:222

    Switch should always have a default. Is there nothing to do if the sortingOrder is ascending? (Sorry, have not checked the logic yet)
  21. Andreas Kienast commented on patch set 9 07/08/15, 07:25

    FileCollector.php:208 Reply

    We supress the "Array was modified by the user comparison function" warning

    FileCollector.php:222 Reply

    No, because "ascending" is handled with the sort() above
  22. Andreas Kienast commented on patch set 9 07/08/15, 07:35

    Feature-67662-DataProcessorForFiles.rst:38 Reply

    This wouldn't work with the current implementation.
  23. Andreas Kienast commented on patch set 9 07/08/15, 07:41

    FileCollector.php:181 Reply

    A folder identifier is at least prefixed with the storage uid and a colon.
  24. Frans Saris commented on patch set 9 07/08/15, 07:42

    Feature-67662-DataProcessorForFiles.rst:38 Reply

    This would indeed be nice but a new patch IMO
  25. Sascha Egerer commented on patch set 9 07/10/15, 06:38

    FilesContentObject.php:35 Reply

    It's not possible to change that without changing the abstract class which then requires that all classes, that implement the abstract class, have to be adjusted as well. Third party Content objects get incompatible too so... i would keep it for now as it is.