95443[BUGFIX] Resolve locale dependencies in LanguageServiceFactory
Commit message
Review
-
Code review CR +2 Done
- Benjamin Kott +2
- Benni Mack +2
- Benjamin Franzke +1
- Garvin Hicking +1
-
Verified V +2 Done
- Benjamin Kott +2
- Benni Mack +2
- Benjamin Franzke +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 4
Review log 1621
-
Benjamin Kott uploaded patch set 1 08/26/26, 23:46
-
core-ci voted on patch set 1 V +1 08/26/26, 23:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107197
-
Josua Vogel voted on patch set 1 CR +1 08/27/26, 08:10
-
Benni Mack updated the commit message in patch set 2
CR +1V +109/23/26, 15:45 -
Benni Mack rebased onto patch set 3 09/23/26, 15:45
-
core-ci voted on patch set 2 V +1 09/23/26, 16:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109078
-
core-ci voted on patch set 3 V +1 09/23/26, 16:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109079
-
Josua Vogel voted on patch set 3 CR +1 09/24/26, 07:05
-
Andreas Kienast commented on patch set 3 10/10/26, 17:11
I wonder whether we can solve this at a lower level instead, namely LanguageServiceFactory: ``` public function create(Locale|string $locale): LanguageService { if (is_string($locale) || $locale->getDependencies() === []) { $locale = $this->locales->createLocale((string)$locale); } $obj = new LanguageService($this->locales, $this->localizationFactory, $this->runtimeCache); $obj->init($locale); return $obj; } ``` Why there: - LocalizationUtility::translate() already calls create($locale), so it's covered with no change to LocalizationUtility itself. - Other callers that pass Locale objects have the same issue and get fixed too: EXT:form's TranslationService::createLanguageService(), PageRenderer, and any extension that does $languageServiceFactory->create($siteLanguage->getLocale()). - It does exactly what createFromSiteLanguage() already does by casting to string. That method could later be simplified to create($language->getLocale()). -
Benni Mack uploaded patch set 4
CR +1V +110/15/26, 12:46 -
Benni Mack commented on patch set 4 CR +1 V +1 10/15/26, 12:47
Reply
thanks, I agree, much better. -
core-ci voted on patch set 4 V +1 10/15/26, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111190
-
Benjamin Franzke commented on patch set 4 10/15/26, 15:13
LanguageServiceFactory.php:35A question because this is a bit hard to understand: Shouldn't `SiteLanguage` create the locale via `Locales->createLocale()` instead of creating an – as it seems – incomplete object (by simply using `new Locale($locale))` right now)? -
Benni Mack commented on patch set 4 10/15/26, 16:05
LanguageServiceFactory.php:35Replyindeed, yes, but IMHO a separate issue. The main problem is that we do not have proper factories for Site + SiteLanguage right now. I stumbled over this multiple times, and I avoided this in SiteLanguages' constructor until now (to keep the objects clean from makeInstance), -
Benjamin Franzke uploaded patch set 5
CR +1V +110/16/26, 11:45 -
core-ci voted on patch set 5 V +1 10/16/26, 11:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111354
-
Benjamin Franzke commented on patch set 5 CR +1 V +1 10/16/26, 12:26
LanguageServiceFactory.php:35ReplyAdapted as discussed in call, by avoiding to recreate a locale with zero dependencies. -
Garvin Hicking voted on patch set 5 CR +1 V +1 10/16/26, 12:57
-
Benni Mack voted on patch set 5 CR +2 V +2 10/16/26, 13:19
-
Benjamin Kott voted on patch set 5 CR +2 V +2 10/16/26, 14:14
-
Benjamin Kott merged patch set 6 10/16/26, 14:14