Review main Merged

70201[BUGFIX] Ensure correct merge of update suggestions

Simon Gilli CR +2 V +2 Easy +1 −1 updated 08/12/21, 16:10

Commit message

The calls to the getUpdateSuggestions() method may result
in the same change is added twice to the same hash. Using
array_replace_recursive() ensures the same two suggestions
are merged correctly and not as array of strings like done
by the former implementation.

This is important for sqlite which creates multiple
statements for one 'job' sometimes.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Daniel Siepmann +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Daniel Siepmann +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1419

  1. Simon Gilli uploaded patch set 1 08/04/21, 15:10

  2. core-ci voted on patch set 1 V +1 08/04/21, 15:19 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14097

  3. Simon Gilli uploaded patch set 2 08/05/21, 14:11

  4. core-ci voted on patch set 2 V +1 08/05/21, 14:21 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14146

  5. Daniel Siepmann commented on patch set 2 V +1 08/05/21, 15:03

    Tested with installation where I found the issue. It is gone when applying the patch. Thanks. The installation is v11, never hat the issue with v10 (never had tested with v9). Maybe the issue is related to other parts of the system which behave differently now. Didn't test the patch with v10 or v9.
  6. Christian Kuhn commented on patch set 2 08/12/21, 15:17

    for reference: array_merge_recursive with 2 same keys and string values turns value into an array having both string. array_replace_recursive uses value of second array, which is what we want here. (the keys are hashes of the statement and the values are the statements). lolli@apoc:~$ cat foo.php <?php $foo = [ 'bar' => 'value' ]; $bar = [ 'bar' => 'value' ]; var_dump(array_merge_recursive($foo, $bar)); var_dump(array_replace_recursive($foo, $bar)); lolli@apoc:~$ php foo.php array(1) { ["bar"]=> array(2) { [0]=> string(5) "value" [1]=> string(5) "value" } } array(1) { ["bar"]=> string(5) "value" }
  7. Christian Kuhn uploaded patch set 3 08/12/21, 15:18

  8. Christian Kuhn commented on patch set 3 V +1 CR +1 08/12/21, 15:20

    Since I'm not 100% sure about v10 and v9 here and the author is only able to reproduce in v11, I restricted to master-only for now. I suppose the issue may be 'unseen' in v10 due to less strict doctrine. We should have this patch in master for a while and only eventually merge to v10 later if this becomes a true issue in v10.
  9. Daniel Siepmann voted on patch set 3 V +1 CR +1 08/12/21, 15:24

  10. Oliver Hader wrote 08/12/21, 15:27

    Removed reviewer Oliver Hader.
  11. Simon Gilli uploaded patch set 4 08/12/21, 15:32

  12. core-ci voted on patch set 4 V -1 08/12/21, 15:35 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14784

  13. core-ci voted on patch set 3 V +1 08/12/21, 15:39 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14779

  14. Simon Gilli uploaded patch set 5 08/12/21, 15:45

  15. Simon Gilli commented on patch set 5 08/12/21, 15:46

    Sorry for pushing PS4, was an accident. PS5=PS3 now
  16. Daniel Siepmann voted on patch set 5 V +1 CR +1 08/12/21, 15:48

  17. core-ci voted on patch set 5 V +1 08/12/21, 16:07 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14791

  18. Christian Kuhn voted on patch set 5 V +2 CR +2 08/12/21, 16:10

  19. Christian Kuhn merged patch set 6 08/12/21, 16:10