Review main Merged Breaking

21428[!!!][FEATURE] Backport recursive and allowing empty validation from Flow

Alexander Schnitzler CR +2 V +2 Expert +1073 −469 updated 04/29/14, 09:03

Commit message

This change enables recursive validation by backporting the TYPO3.Flow
validation API. Also the validators allow empty values now.

This is a breaking change if you expected the previous behavior. In order
to make a property required you now need to add the NotEmptyValidator
explicitly!

This change also changes the validators required return type for the
default property mapper before 6.1. Before this change the isValid method
had to return a boolean value. Now this is not necessary anymore, because
only the errors added by the validator are checked.

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Markus Günther +1
    • Marc Bastian Heinrichs +1
  • Verified V +2
    • Anja Leichsenring +2
    • Markus Günther +1
    • Marc Bastian Heinrichs +1

Issues 2

Files 45

Show 25 more files

Review log 35

Show 10 earlier messages
  1. Alexander Schnitzler rebased onto patch set 1 06/21/13, 10:48

  2. Mr. Jenkins commented on patch set 2 06/21/13, 10:49

  3. Alexander Schnitzler uploaded patch set 3 06/21/13, 10:57

  4. Mr. Jenkins commented on patch set 3 06/21/13, 10:58

  5. Alexander Schnitzler uploaded patch set 4 06/21/13, 12:17

  6. Mr. Jenkins commented on patch set 4 06/21/13, 12:18

  7. Stefan Froemken commented on patch set 4 V +1 06/21/13, 13:12

    I have tested it on PHP 5.3 with all Extbase UnitTests. I created my own extension and it works with enabled PropertyMapper. The code review is a little bit too hard for me.
  8. Anja Leichsenring commented on patch set 4 V +1 06/23/13, 11:18

    CollectionValidator.php:69

    why this early return here and in the branch above? Looks unnessessary.

    ValidatorInterface.php:43

    what is the purpose of commented functions?

    ValidatorResolver.php:133

    instead of throwing and immediatly catching the exception, create the syslog entry here?

    ValidatorResolver.php:194

    use the ClassNameUtility here
  9. Alexander Schnitzler commented on patch set 4 06/23/13, 12:08

    CollectionValidator.php:69 Reply

    It's 100% TYPO3.Flow

    ValidatorInterface.php:43 Reply

    100% TYPO3.Flow

    ValidatorResolver.php:194 Reply

    Will dig into it.
  10. Alexander Schnitzler commented on patch set 4 06/23/13, 12:12

    ValidatorResolver.php:133 Reply

    Exceptions can also be thrown in line 124, so I would like to have just one catch and log until we can get rid of the Exceptions at all.
  1. Wouter Wolters commented on patch set 4 V +1 06/26/13, 19:17

    Really clean patch, found some small thins. I only tested the Unit-tests. No real test with an extension.

    ValidatorResolver.php:133

    TYPO3\Flow\Validation\Validator\ValidatorInterface is the Flow name, can we have the Extbase name here?

    ValidatorResolver.php:137

    missing space after catch

    ValidatorResolver.php:318

    sapce after foreach

    ValidatorResolver.php:546

    space after foreach
  2. Alexander Schnitzler commented on patch set 4 V -1 06/26/13, 20:04

    ValidatorResolver.php:194 Reply

    Confirmed this only works with namespaced Classes, so I have to adjust this again.
  3. Alexander Schnitzler uploaded patch set 5 06/28/13, 07:40

  4. Mr. Jenkins commented on patch set 5 06/28/13, 07:41

  5. Alexander Schnitzler uploaded patch set 6 06/28/13, 09:14

  6. Mr. Jenkins commented on patch set 6 06/28/13, 09:15

  7. Marc Bastian Heinrichs commented on patch set 6 07/02/13, 17:55

    Resolves also #34838

    GenericObjectValidator.php:52

    Translation needed?

    GenericObjectValidator.php:249

    move to top of class

    GenericObjectValidator.php:255

    move to top of class

    NotEmptyValidator.php:74

    Don't think that we should change the timestamps

    StringValidator.php:51

    Change timestamp?
  8. Marc Bastian Heinrichs commented on patch set 6 07/02/13, 18:41

    Btw. works as expected with a test extension
    add "in Extbase"
  9. Alexander Schnitzler commented on patch set 6 07/02/13, 20:48

    GenericObjectValidator.php:249 Reply

    Moving these parts up makes the diff nearly unreviewable. I deliberately put these changes down here to make sure everybody can see the actual changes in this class. I want to create a patch afterwards that rearranges all this.
  10. Alexander Schnitzler commented on patch set 6 07/03/13, 09:54

    GenericObjectValidator.php:52 Reply

    Please let's also do this in another step.
  11. Alexander Schnitzler rebased onto patch set 6 07/03/13, 09:54

  12. Alexander Schnitzler uploaded patch set 8 07/03/13, 09:55

  13. Mr. Jenkins commented on patch set 7 07/03/13, 09:55

  14. Marc Bastian Heinrichs commented on patch set 6 07/03/13, 09:56

    GenericObjectValidator.php:249 Reply

    is ok for me
  15. Mr. Jenkins commented on patch set 8 07/03/13, 09:56

  16. Alexander Schnitzler commented on patch set 8 07/03/13, 10:35

  17. Markus Günther commented on patch set 8 V +1 CR +1 07/04/13, 15:26

    Great patch. Thank you Alex! Works fine with a test Extension, code look good and unit tests gives a green bar feeling.
  18. Marc Bastian Heinrichs commented on patch set 8 V +1 CR -1 07/04/13, 16:08

    Sorry, that forgot this: it should also be noticed, that validators are allow empty values now, what is a breaking change - see Flow change http://forge.typo3.org/projects/package-typo3-flow/repository/revisions/9b627954f289d793b808db2ac19edc6a04c25426 Suggestion: [!!!][FEATURE] Backport Flow recursive and allowing empty validation This change enables recursive validation by backporting the TYPO3.Flow validation api. Also the validators allow empty values now. This is a breaking change if you expected the previous behavior. In order to make a property required you now need to add the NotEmptyValidator explicitly! This change also changes the validators required return type for the default property mapper before 6.1. Before this change the isValid method had to return a boolean value. Now this is not necessary anymore, because only the errors added by the validator are checked.
  19. Marc Bastian Heinrichs uploaded patch set 9 07/04/13, 16:12

  20. Mr. Jenkins commented on patch set 9 07/04/13, 16:13

  21. Marc Bastian Heinrichs commented on patch set 9 V +1 CR +1 07/04/13, 16:14

    Changed the commit message only
  22. Markus Günther voted on patch set 9 V +1 CR +1 07/04/13, 16:17

  23. Anja Leichsenring commented on patch set 9 V +2 CR +2 07/04/13, 16:20

    thank you very much for the effort of backporting this nice and highly apprecciated feature.
  24. Anja Leichsenring merged patch set 10 07/04/13, 16:20

  25. Markus Klein commented on patch set 10 04/29/14, 09:03

    NumberRangeValidator.php:43

    Regression: http://forge.typo3.org/issues/58313 Missing startRange and endRange