86690[BUGFIX] Immediately apply language changes in user setup
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Oli Bartsch +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Oli Bartsch +1
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 4
Review log 1821
-
Andreas Kienast uploaded patch set 1 10/22/24, 14:05
-
Andreas Kienast uploaded patch set 2 10/22/24, 14:06
-
core-ci voted on patch set 1 V +1 10/22/24, 14:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68370
-
core-ci voted on patch set 2 V +1 10/22/24, 14:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68371
-
Andreas Kienast commented on patch set 2 V -1 10/23/24, 06:32
Switching back from rtl -> ltr doesn't work for the content frame. -
Andreas Kienast uploaded patch set 3
V +110/23/24, 06:36 -
Andreas Kienast commented on patch set 3 10/23/24, 06:38
Reply
Done -
Andreas Kienast uploaded patch set 4 10/23/24, 06:39
-
core-ci voted on patch set 4 V +1 10/23/24, 06:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68426
-
Simon Schaufelberger commented on patch set 4 10/25/24, 12:04
SetupModuleController.php:136!== null can be anything. Can we check specifically for a specific class with instanceof? -
Andreas Kienast commented on patch set 4 10/25/24, 12:08
SetupModuleController.php:136ReplyNo it cannot, the `LanguageService->getLocale()` is declared to return null or `Locale`. -
Simon Schaufelberger commented on patch set 4 10/25/24, 12:46
SetupModuleController.php:136Replythat is what I mean. check for `instanceof Locale::class` -
Andreas Kienast commented on patch set 4 10/25/24, 12:47
SetupModuleController.php:136ReplyWhat's the benefit here? I think that's matter of taste. -
Simon Schaufelberger commented on patch set 4 10/25/24, 12:49
SetupModuleController.php:136Replyjust by reading the code you know that you definitely have an object of Locale while with not null as I said it could be anything. -
Andreas Kienast commented on patch set 4 10/25/24, 12:55
SetupModuleController.php:136Reply> [...] it could be anything I get your point, but this is still a wrong assumption. What else could it be in theory, when the method is called `getLocale()` and treated as an object? -
Oli Bartsch commented on patch set 4 CR +1 V +1 10/25/24, 12:55
SetupModuleController.php:136ReplyNo, it can't be anything, that's what the return type is for. It's either NULL or Locale. We want this to be Locale so testing for NOT NULL is correct here. -
Simon Schaufelberger voted on patch set 4 CR +1 V +1 10/25/24, 13:14
-
Benjamin Franzke voted on patch set 4 CR +2 V +2 10/25/24, 14:52
-
Benjamin Franzke commented on patch set 4 10/25/24, 15:01
SetupModuleController.php:136Replybtw, this wrong (because it expresses pseudo uncertainty) usage of `instanceof` would have been forbidden by our custom phpstan `UnneededInstanceOfRule` check 😎 ``` Line setup/Classes/Controller/SetupModuleController.php ------ ------------------------------------------------------------------------------------------- 137 Unneeded instanceof on TYPO3\CMS\Core\Localization\Locale|null. Use a null check instead. ``` See: > 80859: [TASK] Add phpstan check for unneeded pseudo uncertain instanceof usage | https://review.typo3.org/c/Packages/TYPO3.CMS/+/80859 -
Benjamin Franzke merged patch set 5 10/25/24, 15:01
-
Simon Schaufelberger commented on patch set 5 10/25/24, 15:30
SetupModuleController.php:136Reply@ben@bnf.dev thank you for this link! That explains the reason very well why a null check is better than instanceof.