Review main Merged

61963[BUGFIX] Ensure auto redirect respects language host

Guido Schmechel CR +2 V +2 Normal +93 −30 updated 10/03/21, 14:00

Commit message

When creating an automatic redirect, the language
must also be used in the source.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Jonas Eberle +1
    • Guido Schmechel +1
    • Stefan Bürk +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benni Mack +2
    • Jonas Eberle +1
    • Guido Schmechel +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 4053

Show 2428 earlier messages
  1. Guido Schmechel uploaded patch set 1 10/12/19, 11:02

  2. TYPO3com voted on patch set 1 V +1 10/12/19, 11:12 Completed build in 09m 50s on Sat, 12 Oct, 11:12 AM Test Summary: 47982 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37284

  3. Frank Nägler commented on patch set 1 10/12/19, 13:04

    Thx for the patch. this class is fully tested, could you please add tests for the missing cases which will be fixed with this patch?
  4. Tobi Kretschmann voted on patch set 1 CR +1 10/16/19, 06:56

  5. Oliver Klee commented on patch set 1 10/21/19, 11:58

    Can we cover this with tests?
  6. Frank Nägler voted on patch set 1 CR +1 12/06/19, 15:39

  7. Frank Nägler voted on patch set 1 V +1 12/06/19, 15:47

  8. Daniel Goerz commented on patch set 1 CR -1 12/06/19, 17:24

    SlugService.php:157

    $site is actually a $language, right?
  9. Susi Moog commented on patch set 1 V -1 12/06/19, 17:28

    ... and @Frank you wanted to write tests :-P
  10. Frank Nägler uploaded patch set 2 12/06/19, 20:05

  11. Frank Nägler commented on patch set 2 CR -1 12/06/19, 20:07

    the modified tests should prove that we don't have an issue. @Giudo can you please describe the issue and how to reproduce the issue?
  12. TYPO3com voted on patch set 2 V +1 12/06/19, 20:12 Completed build in 07m 15s on Fri, 6 Dec, 08:12 PM Test Summary: 68741 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39214

  13. Guido Schmechel commented on patch set 2 12/07/19, 12:38

    SlugService.php:157 Reply

    It is a site object. "returns a site language object for a language id"
  14. Guido Schmechel commented on patch set 2 12/07/19, 13:02

    > Patch Set 2: Code-Review-1 > > the modified tests should prove that we don't have an issue. > @Giudo can you please describe the issue and how to reproduce the issue? Hi Frank, this is my scenario: - Fresh install (ddev) - Language EN (Default) use domain http://master.ddev.site/ => This is the basic stuff - I added language Danish - Map language Danish to http://www.example.dk (via site config) - Add a page "Test" - Add a translation for page "Test" -> "Test DK" - Just rename the page "Test DK" to "Test DK2" => Auto redirect is added Source Domain in the redirect is master.ddev.site, but should be http://www.example.dk.
  15. Guido Schmechel commented on patch set 2 12/07/19, 13:21

    SlugService.php:157 Reply

    Done
  16. Susi Moog commented on patch set 2 12/07/19, 15:08

    > Patch Set 2: > Hi Frank, this is my scenario: > - Fresh install (ddev) > - Language EN (Default) use domain http://master.ddev.site/ > => This is the basic stuff > > - I added language Danish > - Map language Danish to http://www.example.dk (via site config) > - Add a page "Test" > - Add a translation for page "Test" -> "Test DK" > - Just rename the page "Test DK" to "Test DK2" > => Auto redirect is added > > Source Domain in the redirect is master.ddev.site, but should be http://www.example.dk. Can you take a look at the tests and see how to set up your scenario so it fails before the test?
  17. Daniel Goerz commented on patch set 2 12/07/19, 16:43

    SlugService.php:157 Reply

    I rephrase: A variable holding a SiteLanguage object should not be called $site but $siteLanguage.
  18. Guido Schmechel commented on patch set 2 12/07/19, 20:37

    > Can you take a look at the tests and see how to set up your scenario so it fails before the test? The tests are fine. We now have the mixed version of folder and absolute URL (spanish). If you combine the new tests with the old code, you will also get errors. My scenario was thus covered. Thanks :-)
  19. Susi Moog commented on patch set 2 12/12/19, 07:30

    > Patch Set 2: > > > Can you take a look at the tests and see how to set up your scenario so it fails before the test? > > The tests are fine. We now have the mixed version of folder and absolute URL (spanish). If you combine the new tests with the old code, you will also get errors. My scenario was thus covered. Thanks :-) Hm, that was what Frank meant, the tests don't seem to fail with the old code. Or I misunderstood him.
  20. Guido Schmechel commented on patch set 2 12/14/19, 21:57

    > Hm, that was what Frank meant, the tests don't seem to fail with the old code. Or I misunderstood him. The old tests don't handle the case with the mixture of absolute URLs and folders. That seems to be the crucial detail for this patch.
  21. Susi Moog commented on patch set 2 01/25/20, 15:42

    > Patch Set 2: > > > Hm, that was what Frank meant, the tests don't seem to fail with the old code. Or I misunderstood him. > > The old tests don't handle the case with the mixture of absolute URLs and folders. That seems to be the crucial detail for this patch. Yes, but the new tests don't fail either with the old code, that's what I was wondering about.
  22. Guido Schmechel commented on patch set 2 01/26/20, 11:49

    > Yes, but the new tests don't fail either with the old code, that's what I was wondering about. Unfortunately I cannot reproduce that. If I just change the code back, I get the following expected result: 1) TYPO3\CMS\Core\Tests\Functional\Domain\Repository\SlugServiceTest::rebuildSlugsForSlugChangeRenamesSubSlugsAndCreatesRedirectsWithLanguages wrong redirect found Failed asserting that an array contains Array &0 ( 'source_host' => '*' 'source_path' => '/dummy-1-3' 'target' => '/test-new' ). /c/ddev/master/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php:374 /c/ddev/master/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php:262 2) TYPO3\CMS\Core\Tests\Functional\Domain\Repository\SlugServiceTest::rebuildSlugsForSlugChangeRenamesSubSlugsAndCreatesRedirectsWithLanguagesInSubFolder wrong redirect found Failed asserting that an array contains Array &0 ( 'source_host' => '*' 'source_path' => '/dummy-1-3' 'target' => '/test-new' ). /c/ddev/master/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php:374 /c/ddev/master/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php:301
  23. Guido Schmechel abandoned the change 09/26/20, 12:04

  24. Guido Schmechel restored the change 04/11/21, 16:40

  25. Guido Schmechel rebased onto patch set 3 04/11/21, 16:47

  26. TYPO3com voted on patch set 3 V -1 04/11/21, 16:54 Completed build in 07m 18s on Sun, 11 Apr, 04:54 PM Test Summary: 3 of 33503 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10608

  27. core-ci voted on patch set 3 V -1 04/11/21, 16:59 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2181

  28. Guido Schmechel uploaded patch set 4 04/11/21, 17:08

  1. Guido Schmechel updated the commit message in patch set 5 04/11/21, 17:10

  2. TYPO3com voted on patch set 4 V -1 04/11/21, 17:15 Completed build in 06m 36s on Sun, 11 Apr, 05:15 PM Test Summary: 3 of 33503 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10609

  3. TYPO3com voted on patch set 5 V -1 04/11/21, 17:17 Completed build in 07m 10s on Sun, 11 Apr, 05:17 PM Test Summary: 3 of 33503 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10610

  4. Guido Schmechel uploaded patch set 6 04/11/21, 17:18

  5. core-ci voted on patch set 4 V -1 04/11/21, 17:24 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2182

  6. Oliver Klee wrote 04/11/21, 17:24

    Removed reviewer Oliver Klee.
  7. TYPO3com voted on patch set 6 V +1 04/11/21, 17:25 Completed build in 06m 09s on Sun, 11 Apr, 05:25 PM Test Summary: 33267 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10611

  8. core-ci voted on patch set 5 V -1 04/11/21, 17:30 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2183

  9. core-ci voted on patch set 6 V +1 04/11/21, 17:30 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2184

  10. Jochen Roth voted on patch set 6 V +1 CR +1 05/06/21, 11:41

  11. Stefan Bürk uploaded patch set 7 09/26/21, 14:31

  12. Stefan Bürk commented on patch set 7 CR -1 09/26/21, 14:34

    Rebase this patch - leaving the change of subfolder test intact, as such this will fail. The patch changed the testing structure and silently moved to languages with full hosts, even for subfolder test - which is not good. Need to take time to overwork test to do the tests for changes, but also chang for lanugages without domain in language base uris and keeping the subfolder from the parent. Or the language needs for the subfolder tests also the subfolder in the language base.
  13. core-ci voted on patch set 7 V -1 09/26/21, 14:47 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17198

  14. Stefan Bürk uploaded patch set 8 09/26/21, 15:28

  15. Stefan Bürk commented on patch set 8 09/26/21, 15:34

    Reply

    Doing subfolder test now correctly instead of simple hiding subfolder for host based language. Added subfolder test with defaultLanguage without host based language to cross-test this. The whole test-case should be overworked, or extended to cover more/all possible constellations anyway. As this was not the case before, this should be done in a seperated follow-up patch.
  16. core-ci voted on patch set 8 V +1 09/26/21, 15:47 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17199

  17. Stefan Bürk commented on patch set 8 V +1 CR +1 09/26/21, 15:48

    Tested in running instance, not only functional tests.
  18. Mathias Brodala updated the commit message in patch set 9 09/28/21, 13:37

  19. core-ci voted on patch set 9 V +1 09/28/21, 13:51 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17265

  20. Stefan Bürk voted on patch set 9 V +1 CR +1 09/28/21, 14:04

  21. Guido Schmechel commented on patch set 9 V +1 CR +1 09/28/21, 19:54

    Tested after the last change. Works!
  22. Andreas Kienast voted on patch set 9 CR +1 10/01/21, 13:57

  23. Jonas Eberle voted on patch set 9 V +1 CR +1 10/02/21, 10:55

  24. Benni Mack voted on patch set 9 V +2 CR +2 10/03/21, 14:00

  25. Benni Mack merged patch set 10 10/03/21, 14:00