Review main Merged Breaking

75093[!!!][FEATURE] Use LanguageAspect in QuerySettings for Extbase

Benni Mack CR +2 V +2 Hard +289 −268 updated 07/14/22, 18:55

Commit message

This change adapts the QuerySettings functionality
for Extbase in v12 to allow to work with a LanguageAspect
which contains all information regarding the language ID
and the overlay mode.

For this reason, the following method definitions are removed
within Extbase's QuerySettingsInterface

- setLanguageOverlayMode()
- getLanguageOverlayMode()
- setLanguageUid()
- getLanguageUid()

However, it is still possible to use the existing methods
on the QuerySettings implementation of TYPO3
for TYPO3 v12.

It is now recommended to use ->getLanguageAspect()
and ->setLanguageAspect().

This change is a pre-requisite to extend language
handling across TYPO3 and Extbase.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Oliver Hader +1
    • core-ci +1 CI

Issues 1

Files 14

Review log 3957

Show 2032 earlier messages
  1. Benni Mack uploaded patch set 1 07/11/22, 08:17

  2. core-ci voted on patch set 1 V -1 07/11/22, 08:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28868

  3. Benni Mack uploaded patch set 2 07/11/22, 11:56

  4. core-ci voted on patch set 2 V -1 07/11/22, 12:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28882

  5. Benni Mack uploaded patch set 3 07/12/22, 19:21

  6. core-ci voted on patch set 3 V -1 07/12/22, 19:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29011

  7. Benni Mack uploaded patch set 4 07/13/22, 13:45

  8. core-ci voted on patch set 4 V -1 07/13/22, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29063

  9. Benni Mack uploaded patch set 5 07/13/22, 14:10

  10. core-ci voted on patch set 5 V -1 07/13/22, 14:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29067

  11. Benni Mack uploaded patch set 6 07/13/22, 14:32

  12. core-ci voted on patch set 6 V -1 07/13/22, 14:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29069

  13. Benni Mack uploaded patch set 7 07/13/22, 14:44

  14. core-ci voted on patch set 7 V +1 07/13/22, 14:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29071

  15. Benni Mack uploaded patch set 8 07/13/22, 15:37

  16. core-ci voted on patch set 8 V +1 07/13/22, 15:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29075

  17. Markus Klein commented on patch set 9 07/13/22, 18:01

    Published edit on patch set 8.
  18. Markus Klein commented on patch set 10 07/13/22, 18:03

    Published edit on patch set 9.
  19. core-ci voted on patch set 10 V +1 07/13/22, 18:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29083

  20. core-ci voted on patch set 9 V +1 07/13/22, 18:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29082

  21. Markus Klein commented on patch set 11 07/13/22, 18:22

    Published edit on patch set 10.
  22. core-ci voted on patch set 11 V +1 07/13/22, 18:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29085

  23. Markus Klein commented on patch set 11 07/13/22, 18:33

    Typo3DbBackend.php:522

    I think this should rather be `$fetchLocalizedRecord`, right? (we are not fetching the language record anywhere here)

    Typo3QuerySettings.php:197

    Shouldn't this retain the other options of the current aspect?
  24. Markus Klein commented on patch set 11 07/13/22, 18:42

    QueryLocalizedDataTest.php:251

    until now we tested with OVERLAYS_ON here in the fake TSFE language aspect. Is this change intended?

    QueryLocalizedDataTest.php:326

    shouldn't this be _OFF?

    QueryLocalizedDataTest.php:347

    shouldn't this be _OFF?

    TranslationTest.php:107

    overlay_OFF is missing here

    TranslationTest.php:200

    shouldn't this be _OFF?

    TranslationTest.php:320

    _OFF missing

    TranslationTest.php:345

    here too

    TranslationTest.php:459

    here too and all below..
  25. Benni Mack commented on patch set 11 07/13/22, 19:20

    thanks for the review, Markus!

    QueryLocalizedDataTest.php:251 Reply

    tbh, OVERLAYS_ON should be removed in the future. This means that records without l10n_parent are never shown, Even though the whole concepts of overlays stinks, this is for sure the worst option of the now available 4 options.

    TranslationTest.php:200 Reply

    comment says "This tests shows overlays in action" :) OVERLAYS_FF just fetches records without fallback, as it only queries sys_language_uid=2
  26. Benni Mack uploaded patch set 12 07/14/22, 10:46

  27. core-ci voted on patch set 12 V +1 07/14/22, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29133

  28. Markus Klein commented on patch set 12 07/14/22, 11:37

    Typo3DbBackend.php:522 Reply

    Done

    Typo3QuerySettings.php:197 Reply

    Done

    QueryLocalizedDataTest.php:251 Reply

    Done

    QueryLocalizedDataTest.php:326

    should be _OFF

    QueryLocalizedDataTest.php:347

    should be _OFF

    TranslationTest.php:107 Reply

    Done

    TranslationTest.php:200 Reply

    Done

    TranslationTest.php:320 Reply

    Done

    TranslationTest.php:345 Reply

    Done

    TranslationTest.php:375

    this must be _ON

    TranslationTest.php:459 Reply

    Done
  29. Markus Klein commented on patch set 13 07/14/22, 11:37

    Published edit on patch set 12.
  30. Markus Klein commented on patch set 14 07/14/22, 11:40

    Published edit on patch set 13.
  31. Markus Klein commented on patch set 14 07/14/22, 11:40

    QueryLocalizedDataTest.php:326 Reply

    Done

    QueryLocalizedDataTest.php:326 Reply

    Done

    QueryLocalizedDataTest.php:347 Reply

    Done

    QueryLocalizedDataTest.php:347 Reply

    Done

    TranslationTest.php:375 Reply

    Done
  32. Markus Klein commented on patch set 15 07/14/22, 11:42

    Published edit on patch set 14.
  1. Markus Klein voted on patch set 15 CR +1 07/14/22, 11:43

  2. core-ci voted on patch set 15 V +1 07/14/22, 11:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29139

  3. core-ci voted on patch set 14 V +1 07/14/22, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29138

  4. core-ci voted on patch set 13 V +1 07/14/22, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29137

  5. Oliver Klee commented on patch set 15 07/14/22, 11:55

    QuerySettingsInterface.php:135

    We can use this to let PHPStan know that it's the same instance: @return $this Also, we can have the QuerySettingsInterface native return type.

    Typo3QuerySettings.php:220

    Ditto.

    Typo3QuerySettingsTest.php:137

    I suggest the name setLanguageAspectHasFluentInterface instead (and would also be okay with the current name).

    Typo3QuerySettingsTest.php:139

    We should use assertSame instead so we know it's the same instance.
  6. Benni Mack commented on patch set 15 07/14/22, 13:49

    QuerySettingsInterface.php:135 Reply

    thought about using native return types, but then I think this should apply and be done for all methods of this interface ("Harden QuerySettingsInterface") which would be much cleaner. However, IMHO this should be a separate patch then.
  7. Oliver Klee commented on patch set 15 CR -1 07/14/22, 13:52

    QuerySettingsInterface.php:135 Reply

    I don't think that not having native return types should keep us from adding them for new methods. I would grudgingly okay with not adding the native return types for the new methods now (and prefer to add them now), but we should add the @return $this now for the new method. Otherwise, PHPStan will analyze new method incorrectly.
  8. Benni Mack uploaded patch set 16 07/14/22, 13:53

  9. Benni Mack commented on patch set 15 07/14/22, 13:54

    Typo3QuerySettings.php:220 Reply

    Done

    Typo3QuerySettingsTest.php:137 Reply

    Done

    Typo3QuerySettingsTest.php:139 Reply

    Done
  10. Oliver Klee commented on patch set 16 07/14/22, 13:54

    Thanks, Benni!
  11. Benni Mack commented on patch set 16 07/14/22, 13:54

    QuerySettingsInterface.php:135 Reply

    And I think: Somebody(tm) should do it separately - because: One concern at a time.
  12. core-ci voted on patch set 16 V -1 07/14/22, 14:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29149

  13. Oliver Klee commented on patch set 16 07/14/22, 14:25

    QuerySettingsInterface.php:135 Reply

    Ack
  14. Benni Mack uploaded patch set 17 07/14/22, 15:16

  15. core-ci voted on patch set 17 V +1 07/14/22, 15:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29154

  16. Oliver Hader commented on patch set 17 07/14/22, 17:10

    Typo3DbBackend.php:522

    I don't understand this `|| $languageAspect->getId() === 0;` yet..
  17. Oli Bartsch commented on patch set 17 07/14/22, 18:01

    Looks good to me!

    Typo3DbBackend.php:513

    Use $languageAspect here?
  18. Oli Bartsch voted on patch set 17 V +1 07/14/22, 18:02

  19. Benni Mack uploaded patch set 18 07/14/22, 18:27

  20. Benni Mack commented on patch set 17 07/14/22, 18:28

    Typo3DbBackend.php:513 Reply

    Done

    Typo3DbBackend.php:522 Reply

    added a bit more context to it.
  21. core-ci voted on patch set 18 V +1 07/14/22, 18:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29163

  22. Oliver Hader voted on patch set 18 V +1 CR +1 07/14/22, 18:47

  23. Oli Bartsch voted on patch set 18 V +1 CR +1 07/14/22, 18:48

  24. Benni Mack commented on patch set 18 V +2 CR +2 07/14/22, 18:55

    Typo3DbBackend.php:522 Reply

    Done
  25. Benni Mack merged patch set 19 07/14/22, 18:55