Review main Merged

55848[BUGFIX] Do not write empty array values in form definitions

Ralf Zimmermann CR +2 V +2 Normal +63 −3 updated 04/19/18, 18:01

Commit message

Symfony YAML dumps empty arrays as sequence ("{  }"). Due to this, some
JavaScript modules of the form framework fail to interpret/ set the
correct data type for those properties.

If applied, this commit will ensure that the formEditor unsets empty
array keys on load/ save.

The problem only affects the backend module, not the frontend
formDefinition interpreter.

Review

  • Code review CR +2
    • Frank Nägler +2
    • Björn Jacob +1
    • Kay Strobach +1
    • Oliver Hader +1
  • Verified V +2
    • Frank Nägler +2
    • Björn Jacob +1
    • Kay Strobach +1
    • Oliver Hader +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 2838

Show 1013 earlier messages
  1. Ralf Zimmermann uploaded patch set 1 02/20/18, 22:44

  2. TYPO3com voted on patch set 1 V +1 02/20/18, 22:51 Completed build in 07m 37s on Tue, 20 Feb, 11:51 PM Test Summary: 30905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19956

  3. Björn Jacob updated the commit message in patch set 2 02/21/18, 07:21

  4. TYPO3com voted on patch set 2 V +1 02/21/18, 07:29 Completed build in 07m 49s on Wed, 21 Feb, 08:29 AM Test Summary: 30905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19959

  5. Björn Jacob commented on patch set 2 CR -1 02/21/18, 07:54

    As discussed with Ralf, we should provide a test for this.
  6. Ralf Zimmermann uploaded patch set 3 02/21/18, 08:24

  7. TYPO3com voted on patch set 3 V +1 02/21/18, 08:34 Completed build in 09m 24s on Wed, 21 Feb, 09:34 AM Test Summary: 30908 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19962

  8. Oliver Hader commented on patch set 3 V +1 CR +1 02/21/18, 08:57

    FormEditorController.php:433

    There's ArrayUtility::filterRecursive in master - but only in master. Thus, I'm fine with adding that protected method here (and having tests): +1
  9. Tobi Kretschmann voted on patch set 3 CR +1 02/23/18, 10:27

  10. Frank Nägler voted on patch set 3 CR +1 02/23/18, 12:17

  11. Frank Nägler commented on patch set 3 V +1 CR 0 02/23/18, 12:35

    FormEditorController.php:433 Reply

    I would use ArrayUtility::filterRecursive() here (for master) and backport this implementation for v8. The Test should work for both versions.
  12. Steffen Frese commented on patch set 3 CR -1 03/06/18, 15:36

    FormEditorController.php:433 Reply

    I would also consider a backport as the best solution. Especially because this method does not have the same behaviour like ArrayUtility::filterRecursive . But: ArrayUtility::filterRecursive would filter empty strings, this method does not. also $temp = ['test' => [[]]]; <= ArrayUtility::filterRecursive would not filter this correctly, this method would. So actually both solutions are buggy and do not behave like array_filter() would.

    FormEditorController.php:435

    i see no reason to do this. $array is not passed by reference.
  13. Ralf Zimmermann uploaded patch set 4 03/07/18, 01:09

  1. Ralf Zimmermann commented on patch set 4 03/07/18, 01:12

    FormEditorController.php:433 Reply

    > ArrayUtility::filterRecursive would filter empty strings This must not happen. I need empty strings. > $temp = ['test' => [[]]]; <= ArrayUtility::filterRecursive would not filter this correctly Exact, that's what I need and what ArrayUtility::filterRecursive does not do. I have extended the tests.

    FormEditorController.php:435 Reply

    Done
  2. TYPO3com voted on patch set 4 V +1 03/07/18, 01:17 Completed build in 08m 29s on Wed, 7 Mar, 02:17 AM Test Summary: 30809 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20604

  3. Steffen Frese voted on patch set 4 CR +1 03/07/18, 08:35

  4. Stefan Neufeind voted on patch set 4 CR +1 03/07/18, 18:50

  5. Oliver Hader voted on patch set 4 CR +1 03/07/18, 18:53

  6. Ralf Zimmermann uploaded patch set 5 03/15/18, 21:19

  7. TYPO3com voted on patch set 5 V +1 03/15/18, 21:29 Completed build in 09m 11s on Thu, 15 Mar, 10:29 PM Test Summary: 30882 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-21156

  8. Tobi Kretschmann voted on patch set 5 CR +1 03/19/18, 08:43

  9. Ralf Zimmermann uploaded patch set 6 04/19/18, 09:40

  10. TYPO3com voted on patch set 6 V -1 04/19/18, 09:41 Completed build in 11s on Thu, 19 Apr, 11:41 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22576

  11. Ralf Zimmermann uploaded patch set 7 04/19/18, 09:45

  12. TYPO3com voted on patch set 7 V -1 04/19/18, 09:55 Completed build in 09m 10s on Thu, 19 Apr, 11:55 AM Test Summary: 1 of 31177 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22577

  13. Ralf Zimmermann rebased onto patch set 8 04/19/18, 11:51

  14. TYPO3com voted on patch set 8 V +1 04/19/18, 12:03 Completed build in 11m 57s on Thu, 19 Apr, 02:03 PM Test Summary: 31025 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22584

  15. Björn Jacob voted on patch set 8 V +1 CR +1 04/19/18, 12:52

  16. Kay Strobach uploaded patch set 9 04/19/18, 13:52

  17. TYPO3com voted on patch set 9 V -1 04/19/18, 14:03 Completed build in 10m 30s on Thu, 19 Apr, 04:03 PM Test Summary: 3 of 31177 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22602

  18. Kay Strobach commented on patch set 9 04/19/18, 14:31

    i'll take a look and fix it
  19. Kay Strobach uploaded patch set 10 04/19/18, 14:53

  20. TYPO3com voted on patch set 10 V +1 04/19/18, 15:03 Completed build in 10m 13s on Thu, 19 Apr, 05:03 PM Test Summary: 31025 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22606

  21. Björn Jacob voted on patch set 10 V +1 CR +1 04/19/18, 16:14

  22. Kay Strobach voted on patch set 10 V +1 CR +1 04/19/18, 17:23

  23. Frank Nägler voted on patch set 10 V +2 CR +2 04/19/18, 18:00

  24. Frank Nägler merged patch set 11 04/19/18, 18:00

  25. Oliver Hader voted on patch set 11 V +1 CR +1 04/19/18, 18:01