Review main Merged

25687[FEATURE] Paginate should handle non-query-result objects

Tom CR +2 V +2 Hard +241 −15 updated 01/30/17, 17:56

Commit message

Sometimes it is necessary to use an object storage or
an array instead of a query result.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Anja Leichsenring +1
  • Verified V +2
    • Christian Kuhn +2
    • Anja Leichsenring +1

Issues 1

Files 4

Review log 57

Show 32 earlier messages
  1. Mr. Jenkins commented on patch set 1 CR -1 V -1 11/26/13, 11:20

  2. Tom uploaded patch set 2 11/26/13, 12:55

  3. Mr. Jenkins commented on patch set 2 11/26/13, 13:08

  4. Oliver Klee commented on patch set 2 11/26/13, 13:31

    Shouldn't the function that at least check whether the passed object is an array or a Traversable and throw an InvalidArgumentException otherwise? This would help in debugging problems.
  5. Tom uploaded patch set 3 11/27/13, 10:41

  6. Marc Bastian Heinrichs commented on patch set 3 CR -2 11/27/13, 10:57

    It's feature freeze so I block the patch till 6.2 has it's own branch.
  7. Mr. Jenkins commented on patch set 3 11/27/13, 10:58

  8. Tobias Wollender voted on patch set 3 CR +1 01/05/14, 13:37

  9. Nikolas Hagelstein commented on patch set 3 CR +1 03/27/14, 10:31

    Must have!
  10. Sven Külpmann commented on patch set 3 V +1 CR +1 07/08/14, 12:51

    works for my Query-Objects just as good as or my arrays. must have!
  11. Markus Klein commented on patch set 3 07/08/14, 12:58

    @Sven: how did you test this on master, if the patch does not even apply? Did you fix the patch? Then push it please.
  12. Tom uploaded patch set 4 07/15/14, 16:09

  13. Markus Klein updated the commit message in patch set 5 07/15/14, 16:11

  14. Markus Klein commented on patch set 5 CR -1 07/15/14, 16:17

    PaginateController.php:31

    List them all please.

    PaginateController.php:62

    @throws missing

    PaginateController.php:76

    Modified.. we do not use such comments. The commit message tells us what is changed. The if condition is self-explaining

    PaginateController.php:77

    I don't know the exact difference between is_a() and instanceof, but I would prefer instanceof, if there's no special reason. Additionally an is_object() test is needed

    PaginateController.php:89

    We use (int)

    PaginateController.php:90

    IMO there should be a check for SplStorage too. Does that make sense?

    PaginateViewHelper.php:62

    Here too, please don't use mixed, but specify all allowed types
  15. Alexander Opitz commented on patch set 5 09/12/14, 08:32

    Tom Ruether, are you working on this issue?
  16. Marc Bastian Heinrichs voted on patch set 5 CR 0 09/12/14, 10:03

  17. Mathias Schreiber wrote 12/17/14, 14:33

    Topic set to EXT: fluid
  18. Frank Nägler commented on patch set 5 CR -1 12/21/14, 19:17

    I am on it
  19. Frank Nägler commented on patch set 5 12/21/14, 19:44

    new patchset will follow soon

    PaginateController.php:31 Reply

    Done

    PaginateController.php:76 Reply

    Done

    PaginateController.php:77 Reply

    Done

    PaginateController.php:89 Reply

    Done

    PaginateController.php:90 Reply

    Maybe, but I think the two additional cases enough.

    PaginateViewHelper.php:62 Reply

    Done
  20. Frank Nägler uploaded patch set 6 12/21/14, 20:01

  21. Frank Nägler voted on patch set 6 V +1 CR +1 12/21/14, 20:03

  22. Anja Leichsenring commented on patch set 6 CR -1 12/21/14, 20:19

    works nicely, but after this is a Feature, please add a documentation file to sysext:core/Documentation/Changelog/master. You find examples there.
  23. Frank Nägler uploaded patch set 7 12/21/14, 20:29

  24. Frank Nägler commented on patch set 7 V +1 CR +1 12/21/14, 20:29

    thx for hint Anja, I added the missing rst file
  25. Georg Ringer voted on patch set 7 CR +1 V +1 12/21/14, 21:22

  26. Stefan Froemken commented on patch set 7 12/22/14, 08:20

    What about SplObjectStorage?

    PaginateController.php:113

    Please use $itemsPerPage from above
  27. Alexander Opitz commented on patch set 7 CR -1 12/22/14, 08:26

    PaginateController.php:113

    Use $itemsPerPage
  28. Frank Nägler commented on patch set 7 12/22/14, 08:27

    PaginateController.php:113 Reply

    you are right, will push a new set

    PaginateController.php:113 Reply

    And you are right too ;)
  29. Frank Nägler uploaded patch set 8 12/22/14, 08:48

  30. Frank Nägler commented on patch set 8 12/22/14, 08:49

    I have added a check agains \ArrayAccess which allow the use of SplObjectStorage too and is more generic.
  31. Stefan Froemken commented on patch set 8 V -1 12/22/14, 09:01

    It does not work with ObjectStorage: PHP Warning: array_slice() expects parameter 1 to be array, object given
  32. Frank Nägler commented on patch set 8 V -1 12/22/14, 09:53

    On it again, will add some tests and fix the problem with ObjectStorage
  1. Frank Nägler uploaded patch set 9 12/22/14, 11:21

  2. Frank Nägler commented on patch set 9 V -1 12/22/14, 11:21

    one of the tests not working yet and the other new tests should be checked by an unit test expert.
  3. Mathias Brodala commented on patch set 9 CR -1 12/22/14, 11:23

    PaginateControllerTest.php:178

    No assertions?
  4. Frank Nägler uploaded patch set 10 12/22/14, 12:38

  5. Frank Nägler commented on patch set 10 12/22/14, 12:39

    Tests now running, but someone else should check the tests.
  6. Frank Nägler uploaded patch set 11 12/22/14, 13:19

  7. Anja Leichsenring uploaded patch set 12 01/02/15, 22:39

  8. Anja Leichsenring commented on patch set 12 V -1 01/02/15, 22:42

    I added some unit tests for the proposed input types of object collections. Please note the test for SplObjectStorage, that is marked as skipped. There is no way to get access of individual items with offsetGet(), like proposed in this change. This will fail, because offsetGet expects an object, not an integer type! I suggest to remove SplObject from the possibilities and stick with ObjectStorage, array and QueryResult. If no one objects or improves, I will do that on sunday evening.
  9. Anja Leichsenring uploaded patch set 13 01/18/15, 15:21

  10. Anja Leichsenring voted on patch set 13 CR +1 V +1 01/18/15, 15:22

  11. Anja Leichsenring updated the commit message in patch set 14 01/18/15, 15:22

  12. Anja Leichsenring voted on patch set 14 CR +1 V +1 01/18/15, 15:22

  13. Oliver Klee commented on patch set 14 CR -1 01/18/15, 15:23

    PaginateController.php:87

    The @throws should move to prepareObjectsSlice.

    PaginateController.php:172

    The @throws should go in here.
  14. Anja Leichsenring commented on patch set 14 01/18/15, 15:45

    @Olly: I value your involvement, but would you mind, instead of freely commenting and voting -1, to push updates for the changes you propose? This would in fact be helpful, instead of killing motivation. Sorry when this goes over harsh, but really, finding your votes everywhere does not improve motivation. Thanks anyway, your notices are valid.
  15. Oliver Klee commented on patch set 14 01/18/15, 15:51

    I'll push a new version in a minute. It looks like some people prefer doing the changes themselves (so they don't have to re-create their branch and re-cherry-pick while they're working on it), while others prefer the reviewers to push new version.
  16. Anja Leichsenring commented on patch set 14 01/18/15, 15:53

    thank you. Why don't you join us on Slack? We could work together instead isolated. It's more effective, and fun, too.
  17. Oliver Klee commented on patch set 14 01/18/15, 15:57

    Which channel are you currently on? typo3-cms?
  18. Oliver Klee uploaded patch set 15 01/18/15, 16:00

  19. Oliver Klee commented on patch set 14 01/18/15, 16:00

    PaginateController.php:87 Reply

    Done
  20. Anja Leichsenring voted on patch set 15 CR +1 V +1 01/18/15, 17:08

  21. Christian Kuhn voted on patch set 15 CR +1 V +1 01/18/15, 21:28

  22. Christian Kuhn voted on patch set 15 CR +2 V +2 01/18/15, 21:28

  23. Christian Kuhn merged patch set 15 01/18/15, 21:29

  24. Stefan Neufeind commented on patch set 16 04/27/15, 07:28

    For those interested: Backported this to 6.2 locally and works fine.
  25. Nicole Hummel commented on patch set 16 01/30/17, 17:56

    PaginateController.php:187

    This enforces non-existing array elements in $modifiedObjects for the last page if endOfRange is higher than available array items. I will push an update