Review main Merged

63439[TASK] use strict type comparison for isValueSelected

TYPO3com CR +2 V +2 Normal +92 −13 updated 02/28/20, 08:38

Commit message

\TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper::isSelected
uses a strict type comparison but the OptionViewHelper does not.

This resulted in funny results when the values were convertable to int
like this:
var_dump(in_array(1, ['1-2'])); // prints bool(true)

The value is now converted to a string, just like in the
SelectViewHelper, and then strictly compared.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Daniel Goerz +1
    • Susi Moog +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1522

  1. TYPO3com uploaded patch set 1 02/26/20, 10:21

  2. Mathias Brodala commented on patch set 1 CR -1 02/26/20, 10:24

    OptionViewHelper.php:80 Unresolved

    These two can be merged by checking against \Traversable. This and array are the only iterable types in PHP ATM, see is_iterable(). Also it is not necessary to explicitly call \IteratorAggregate->getIterator() since the class implementing \IteratorAggregate is iterable by itself already.
  3. Mathias Brodala commented on patch set 2 02/26/20, 10:25

    Published edit on patch set 1.
  4. TYPO3com voted on patch set 1 V +1 02/26/20, 10:31 Completed build in 10m 16s on Wed, 26 Feb, 10:31 AM Test Summary: 71997 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-714

  5. TYPO3com voted on patch set 2 V +1 02/26/20, 10:35 Completed build in 10m 04s on Wed, 26 Feb, 10:35 AM Test Summary: 71997 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-715

  6. Oliver Klee commented on patch set 2 02/26/20, 13:44

    OptionViewHelper.php:75

    This change seems to be unrelated.
  7. Mathias Brodala commented on patch set 2 CR -1 02/26/20, 14:01

    OptionViewHelper.php:75 Reply Unresolved

    That's true, it's just an iteration (heh) of the originally suggested change and should be done separately.
  8. Mathias Brodala commented on patch set 3 02/26/20, 14:02

    Published edit on patch set 2.
  9. Oliver Klee voted on patch set 3 CR +1 02/26/20, 14:08

  10. TYPO3com voted on patch set 3 V -1 02/26/20, 14:12 Completed build in 10m 15s on Wed, 26 Feb, 02:12 PM Test Summary: 71702 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-718

  11. TYPO3com voted on patch set 3 V +1 02/26/20, 14:25 Completed build in 10m 18s on Wed, 26 Feb, 02:25 PM Test Summary: 71997 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-719

  12. Susi Moog voted on patch set 3 CR +1 02/27/20, 13:15

  13. Susi Moog commented on patch set 3 CR -1 02/27/20, 13:36

    found at least one other bug while testing, will try to write some tests.
  14. Susi Moog uploaded patch set 4 02/27/20, 13:55

  15. TYPO3com voted on patch set 4 V -1 02/27/20, 13:55 Completed build in 21s on Thu, 27 Feb, 01:55 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-739

  16. Susi Moog commented on patch set 4 02/27/20, 13:56

    OptionViewHelper.php:48 Unresolved

    this now takes care of correct selection when childContent is used as fallback value.
  17. Susi Moog uploaded patch set 5 02/27/20, 13:57

  18. TYPO3com voted on patch set 5 V +1 02/27/20, 14:08 Completed build in 10m 20s on Thu, 27 Feb, 02:08 PM Test Summary: 72045 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-740

  19. Susi Moog voted on patch set 5 V +1 CR +1 02/27/20, 18:39

  20. Daniel Goerz voted on patch set 5 CR +1 02/27/20, 18:55

  21. Georg Ringer voted on patch set 5 V +2 CR +2 02/28/20, 08:38

  22. Georg Ringer merged patch set 6 02/28/20, 08:38