Review main Merged

82771[BUGFIX] Undefined array index for TCA without ctrl

Simon Schaufelberger CR +2 V +2 Normal +129 −17 updated 02/07/24, 16:21

Commit message

A new test case is added to cover the case when a TCA definition exists
without `ctrl`. The test case has been added to the test extension
`blog_example` which is not part of the public extension.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 3040

Show 1215 earlier messages
  1. Simon Schaufelberger uploaded patch set 1 02/02/24, 18:44

  2. core-ci voted on patch set 1 V +1 02/02/24, 18:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52645

  3. Stefan Bürk voted on patch set 1 CR +1 V +1 02/02/24, 19:11

  4. Oliver Klee commented on patch set 1 CR +1 V +1 02/02/24, 20:30

    Have you checked whether 11.5 is affected as well?
  5. Simon Schaufelberger commented on patch set 1 02/02/24, 23:22

    Reply

    Good point, the code can be fixed there as well. I just didn't get an error because of php7.4
  6. Simon Schaufelberger updated the commit message in patch set 2 CR +1 V +1 02/02/24, 23:22

  7. core-ci voted on patch set 2 V +1 02/02/24, 23:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52646

  8. Simon Schaufelberger commented on patch set 2 02/02/24, 23:30

    There is also a missing check on the method "getLanguageStatement". Should I add ``` if (!is_array($GLOBALS['TCA'][$tableName]['ctrl'] ?? null)) { return ''; } ``` there as well?
  9. Simon Schaufelberger commented on patch set 2 02/02/24, 23:32

    Reply

    For getVisibilityConstraintStatement it actually exists!
  10. Stefan Bürk commented on patch set 2 02/03/24, 07:38

    Reply

    if you are on it, add it.
  11. Oliver Klee voted on patch set 2 CR +1 V +1 02/03/24, 09:33

  12. Simon Schaufelberger commented on patch set 2 CR -1 V -1 02/03/24, 10:15

    on it...
  13. Simon Schaufelberger uploaded patch set 3 CR +1 V +1 02/03/24, 23:35

  14. core-ci voted on patch set 3 V +1 02/03/24, 23:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52667

  15. Simon Schaufelberger uploaded patch set 4 V +1 02/04/24, 00:11

  1. Simon Schaufelberger commented on patch set 4 02/04/24, 00:13

    Reply

    Done

    Reply

    Done
    Also added a test to cover this case
  2. core-ci voted on patch set 4 V +1 02/04/24, 00:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52668

  3. Simon Schaufelberger uploaded patch set 5 V +1 02/04/24, 00:24

  4. Simon Schaufelberger commented on patch set 5 02/04/24, 00:25

    It's interesting that `empty` ignores the undefined array index which I would have expected that it doesn't do that.
  5. Simon Schaufelberger uploaded patch set 6 02/04/24, 00:27

  6. Simon Schaufelberger wrote 02/04/24, 00:30

    Topic set to extbase
  7. core-ci voted on patch set 5 V +1 02/04/24, 00:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52669

  8. Simon Schaufelberger updated the commit message in patch set 7 02/04/24, 00:31

  9. core-ci voted on patch set 6 V +1 02/04/24, 00:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52670

  10. Simon Schaufelberger uploaded patch set 8 02/04/24, 00:33

  11. core-ci voted on patch set 8 V +1 02/04/24, 00:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52672

  12. core-ci voted on patch set 7 V +1 02/04/24, 00:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52671

  13. Stefan Bürk commented on patch set 8 CR -1 02/04/24, 04:45

    Commit message is not sufficient anymore. Please describe the added tests and fixture classes in one sentence. The added `table` surfes which purpose for the `blog example` - it's unrelated and added soly for a test - or am I wrong ?

    Typo3DbQueryParser.php:762

    superflous, covered by the `empty()` check. Note: empty() with a undefined array key access does not emit that warning.

    ext_tables.sql:6

    suerflous change - unrelated to commit message - and technical irrelevant - samte like the others. Let's keep them as is in the whole file
  14. Simon Schaufelberger uploaded patch set 9 CR -1 V +1 02/04/24, 16:46

  15. Simon Schaufelberger commented on patch set 8 02/04/24, 16:47

    Reply

    Done - yes, this test is only added to cover this case, otherwise I would need to load one of the other extensions as well, which I could do of course if requested.

    Typo3DbQueryParser.php:762 Reply

    Done

    ext_tables.sql:6 Reply

    Done
  16. core-ci voted on patch set 9 V +1 02/04/24, 16:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52691

  17. Oliver Klee voted on patch set 9 V +1 02/04/24, 20:09

  18. Oliver Klee voted on patch set 9 CR +1 02/04/24, 20:10

  19. Simon Schaufelberger updated the commit message in patch set 10 CR +1 V +1 02/04/24, 21:37

  20. Oliver Klee voted on patch set 10 CR +1 V +1 02/04/24, 21:40

  21. core-ci voted on patch set 10 V +1 02/04/24, 21:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52696

  22. Stefan Bürk commented on patch set 10 CR +2 V +2 02/05/24, 12:32

    Note: A TCA controlled table without a CTRL section is considerably broken. However, taking this bugfix as it mitigates array key access warnings without changing a behaviour. See issue for comments about the broken and why the described use-case should be rethought. Avoiding array key access warnings however is legit.
  23. Stefan Bürk voted on patch set 10 CR -1 02/05/24, 12:56

  24. Stefan Bürk voted on patch set 10 CR +2 02/07/24, 16:21

  25. Stefan Bürk merged patch set 11 02/07/24, 16:21