Review main Merged

71516[BUGFIX] Fix PHP8 warning from PageSlugCandidateProvider

Stefan Bürk CR +2 V +2 Easy +3 −1 updated 10/11/21, 11:35

Commit message

In PageSlugCandidateProvider the pageCandidate MPVar has
been build conditional based on of original MPVar was set.
The check did not checked for not existing index which
throws an 'undefined index'.

This patch uses the correct check to prevent that warning.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Jochen Roth +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2431

Show 46 earlier messages
  1. Stefan Bürk uploaded patch set 1 10/09/21, 10:33

  2. core-ci voted on patch set 1 V +1 10/09/21, 10:47 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17863

  3. Oliver Klee commented on patch set 1 10/09/21, 10:54

    PageSlugCandidateProvider.php:391

    I propose we split this up into multiple statements. I find these nested ?? and ? operators hard to understand at a glance.
  4. Stefan Bürk uploaded patch set 2 10/09/21, 12:02

  5. Stefan Bürk commented on patch set 2 10/09/21, 12:15

    PageSlugCandidateProvider.php:391 Reply

    Personally I cannot follow you on that. Even if it does not really make a difference for me if it is a 5 line if/else block or that original one line, I find it faster to regnoze it with the oneline - even if it s a matter of a millisecond or so. I also wanted to ommit a magig !empty() check her (which would mitigated this discussion here). But I get your point that this may differ for others, so maybe the pushed compromise is okay for you ? If not, I will split it up to the full blown if/else block.
  6. core-ci voted on patch set 2 V +1 10/09/21, 12:26 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17866

  1. Georg Ringer commented on patch set 2 10/10/21, 06:38

    can you please improve the 1st line the commit messsage according to https://docs.typo3.org/m/typo3/guide-contributionworkflow/master/en-us/Appendix/CommitMessage.html#summary-line-first-line so it should be something like "[BUGFIX] Fix PHP8 warning from PageSlugCanidateProvider thanks
  2. Stefan Bürk updated the commit message in patch set 3 10/10/21, 08:32

  3. Stefan Bürk commented on patch set 3 10/10/21, 08:32

    Reply

    done
  4. core-ci voted on patch set 3 V +1 10/10/21, 08:48 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17886

  5. Oliver Klee commented on patch set 3 10/10/21, 08:51

    > But I get your point that this may differ for others, so maybe the pushed compromise is okay for you ? If not, I will split it up to the full blown if/else block. Yes, I'd prefer an if/else block. I also can do it if you like. (Improving code readability is one of my superpowers, along with the ability of measuring 7 grams of tea leaves with my bare hands. ;-) )
  6. Stefan Bürk commented on patch set 3 10/10/21, 09:11

    Reply

    Go ahead.(If/Else is more context to visualize and process than one line - that's more are personal flavor discussion here than code improvement, which I do not continue here - so feel free to change).
  7. Oliver Klee commented on patch set 3 10/10/21, 09:26

    PageSlugCandidateProvider.php:391 Reply

    Done
  8. Oliver Klee uploaded patch set 4 10/10/21, 09:26

  9. core-ci voted on patch set 4 V +1 10/10/21, 09:53 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17888

  10. Stefan Bürk uploaded patch set 5 10/10/21, 10:05

  11. core-ci voted on patch set 5 V +1 10/10/21, 10:19 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17890

  12. Oliver Klee commented on patch set 5 CR -1 10/10/21, 10:23

    PageSlugCandidateProvider.php:391

    This changes the semantics. We either should revert the latest change, add a bool cast, or remove the „has“ from the name. I‘m for reverting.
  13. Stefan Bürk abandoned the change 10/10/21, 11:07

  14. Stefan Bürk restored the change 10/10/21, 11:10

  15. Stefan Bürk uploaded patch set 6 10/10/21, 11:15

  16. Stefan Bürk commented on patch set 6 10/10/21, 11:16

    PageSlugCandidateProvider.php:391 Reply

    Sry. You changed the semantic before hand. We should not introduce a unneeded variable here at all which only purpose is to be used once in the next line as condition where the condition be place itselve. Furthermore that variable unneccesiarly lives for the rest of the function scope, or should be unsset.
  17. Oliver Klee voted on patch set 6 CR +1 10/10/21, 11:27

  18. core-ci voted on patch set 6 V -1 10/10/21, 11:46 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17891

  19. core-ci voted on patch set 6 V +1 10/10/21, 11:58 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17891

  20. Stefan Bürk commented on patch set 6 10/10/21, 13:03

    PageSlugCandidateProvider.php:391 Reply

    Done
  21. Benni Mack voted on patch set 6 CR +1 10/10/21, 18:27

  22. Christian Kuhn voted on patch set 6 V +1 CR +1 10/11/21, 10:41

  23. Jochen Roth voted on patch set 6 V +1 CR +1 10/11/21, 11:35

  24. Christian Kuhn voted on patch set 6 V +2 CR +2 10/11/21, 11:35

  25. Christian Kuhn merged patch set 7 10/11/21, 11:35