Review main Abandoned Breaking

43536[!!!][BUGFIX] Allow checking conditions for "empty" values (not set or zero)

Stefan Neufeind CR 0 V 0 Normal +108 −12 updated 04/01/16, 09:15

Commit message

Worked already: [globalVar = GP:type = 10]
Now works as well: [globalVar = GP:type = 0]

The same goes for all number-comparisons: <=, >=, <, >, != and =

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 5

Review log 25

  1. Stefan Neufeind uploaded patch set 1 09/24/15, 18:49

  2. Oliver Hader uploaded patch set 2 10/09/15, 00:21

  3. Markus Klein commented on patch set 2 10/15/15, 22:34

    Breaking-46935-AllowCheckingConditionsForEmptyValuesNotSetOrZero.rst:9

    this implicitly means that if type is not set, we assume it to be 0. that only works for certain parameters, but for sure not for all. We rather need a way to distinguish between, not set, empty and 0

    AbstractConditionMatcherTest.php:133

    invokeArgs
  4. Stefan Neufeind commented on patch set 2 10/15/15, 23:23

    Breaking-46935-AllowCheckingConditionsForEmptyValuesNotSetOrZero.rst:9 Reply

    Note we talk about number-comparisons! the method is "compareNumber".
  5. Benni Mack commented on patch set 2 11/30/15, 21:51

    This is rather a breaking change, as we change the expected behaviour. Should go into v8 only IMHO.
  6. Stefan Neufeind commented on patch set 2 11/30/15, 22:28

    Benni, do I overlook something? We're talking about number-comparisons. And we're changing a behaviour that was not defined (or not working) before while the rest continues to function as before, or not? But after all, I will accept your decision on this.
  7. Benni Mack commented on patch set 2 12/04/15, 13:19

    Just saying... We have installations where we explicitly check for [globalVar = GP:type = ] [else] ... do my stuff [global] as this bug was present - but your patches might break a lot of existing websites - thus it's breaking (as you marked it already) - so I stated "we should wait until we branched off v7 to only get it in v8".
  8. Stefan Neufeind commented on patch set 2 12/04/15, 15:11

    Thanks for the hint. I haven't seen that code with the else-workaround yet - and solved my cases different since the zero-compare didn't work. Let's look at it then for CMS 8.
  9. Benni Mack wrote 03/06/16, 00:21

    Patch set 3: Published edit on patch set 2.
  10. Benni Mack voted on patch set 3 CR +1 03/06/16, 00:21

  11. Markus Klein voted on patch set 3 CR +1 03/10/16, 00:02

  12. Andreas Kienast wrote 03/11/16, 07:38

    Patch set 4: Commit message was updated.
  13. Andreas Kienast commented on patch set 4 CR -1 03/11/16, 07:39

    Breaking-46935-AllowCheckingConditionsForEmptyValuesNotSetOrZero.rst:30

    Is this todo or is there no migration possible? If the latter, please write a meaningful sentence.
  14. Benni Mack commented on patch set 5 03/31/16, 18:05

    Published edit on patch set 4.
  15. Susi Moog voted on patch set 5 CR +1 V +1 03/31/16, 20:17

  16. Morton Jonuschat voted on patch set 5 CR +1 V +1 03/31/16, 20:19

  17. Susi Moog voted on patch set 5 CR 0 V 0 03/31/16, 20:25

  18. Oliver Hader commented on patch set 5 CR -1 03/31/16, 20:27

    I'd like to test that
  19. Morton Jonuschat voted on patch set 5 CR 0 V 0 03/31/16, 20:27

  20. Oliver Hader commented on patch set 5 V -1 03/31/16, 20:36

    This is not a bugfix. This is rather a feature, since it enforces weak type casting on zero and empty strings. Currently, without the patch, checking for "= 0" and "= " already works if the accordant argument values is "0" or empty. The current solution thus allows to check for either of both scenarios. In general I don't see a need for this feature.
  21. Susi Moog commented on patch set 5 03/31/16, 20:38

    what does not work is just 0 = '' and '' = 0, which is strictly speaking correct. from what the tests say you could chain conditions (checking for '' OR checking for 0) to achieve what you want. or can't you?
  22. Oliver Hader commented on patch set 5 03/31/16, 20:45

    See my notes in the Forge issue: https://forge.typo3.org/issues/46935#note-10 A check for either zero or empty values currently can be done with: [globalVar = GP:test = 0, GP:test =] This is not a bugfix!!
  23. Oliver Hader voted on patch set 5 CR -2 03/31/16, 20:45

  24. Christian Kuhn commented on patch set 5 04/01/16, 09:15

    i'm totally with olly here and suggest to abandon this patch for now. in case anyone comes up with a new solution, this patch could be used as inspiration.
  25. Christian Kuhn abandoned the change 04/01/16, 09:15