74507[BUGFIX] Use SiteInterface instead of Site as type declaration
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 35
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php+2 −2
- typo3/sysext/backend/Tests/Functional/Form/FormDataProvider/TcaCategoryTest.php+2 −1
- typo3/sysext/backend/Tests/Unit/Configuration/TranslationConfigurationProviderTest.php+2 −1
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php+2 −1
- typo3/sysext/core/Classes/Configuration/Parser/PageTsConfigParser.php+3 −2
- typo3/sysext/core/Classes/Configuration/PageTsConfig.php+3 −3
- typo3/sysext/core/Classes/Configuration/SiteConfiguration.php+3 −2
- typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php+5 −5
- typo3/sysext/core/Classes/Routing/Aspect/SiteAccessorTrait.php+6 −6
- typo3/sysext/core/Classes/Routing/PageRouter.php+4 −4
- typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php+5 −5
- typo3/sysext/core/Classes/Site/Entity/NullSite.php+31 −0
- typo3/sysext/core/Classes/Site/Entity/Site.php+2 −2
- typo3/sysext/core/Classes/Site/Entity/SiteInterface.php+35 −0
- typo3/sysext/core/Classes/Site/SiteAwareInterface.php+5 −5
- typo3/sysext/core/Classes/Site/SiteFinder.php+9 −9
- typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedAliasMapperTest.php+2 −1
- typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedPatternMapperTest.php+3 −2
- typo3/sysext/core/Tests/Unit/Localization/LocalesTest.php+2 −1
- typo3/sysext/core/Tests/Unit/Site/Entity/SiteLanguageTest.php+2 −1
Show 15 more files
- typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php+3 −2
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php+5 −4
- typo3/sysext/frontend/Classes/DataProcessing/LanguageMenuProcessor.php+3 −2
- typo3/sysext/frontend/Classes/Event/FilterMenuItemsEvent.php+3 −3
- typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php+7 −6
- typo3/sysext/frontend/Classes/Middleware/TypoScriptFrontendInitialization.php+2 −2
- typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php+4 −5
- typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTestTrait.php+2 −5
- typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php+2 −1
- typo3/sysext/frontend/Tests/Unit/Http/RequestHandlerTest.php+2 −1
- typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php+6 −5
- typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php+2 −1
- typo3/sysext/frontend/Tests/Unit/Plugin/AbstractPluginTest.php+2 −1
- typo3/sysext/redirects/Classes/Service/IntegrityService.php+4 −4
- typo3/sysext/seo/Classes/HrefLang/HrefLangGenerator.php+2 −2
Review log 3241
Show 1216 earlier messages
-
Georg Ringer uploaded patch set 1 05/03/22, 21:51
-
Georg Ringer commented on patch set 1 05/03/22, 21:51
This change is ready for review. -
Benni Mack commented on patch set 1 05/03/22, 21:54
Should this go into 11.5 as well? Can we somehow add a test (I guess functional or acceptance) so this won't happen anymore? Also: I think we have a TSFE->getSite() method which we should check as well. -
core-ci voted on patch set 1 V -1 05/03/22, 21:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26777
-
Georg Ringer commented on patch set 1 05/03/22, 22:05
not so sure if this can be breaking for sites on 11? -
Georg Ringer uploaded patch set 2 05/03/22, 22:09
-
core-ci voted on patch set 2 V -1 05/03/22, 22:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26778
-
Georg Ringer uploaded patch set 3 05/03/22, 22:23
-
core-ci voted on patch set 3 V -1 05/03/22, 22:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26779
-
Josef Glatz commented on patch set 3 05/04/22, 05:01
Reply
will check if this can happen in v11 too. -
Josef Glatz commented on patch set 3 CR -1 05/04/22, 05:33
not readable. some word is missing -
Georg Ringer updated the commit message in patch set 4 05/04/22, 06:33
-
core-ci voted on patch set 4 V -1 05/04/22, 06:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26785
-
Georg Ringer uploaded patch set 5 05/04/22, 07:19
-
Benjamin Franzke commented on patch set 5 05/04/22, 07:41
If we want to use this consequently, then there are more places to adapt: git grep ": Site$" typo3/sysext/core/Classes/Routing/Aspect/SiteAccessorTrait.php: public function getSite(): Site typo3/sysext/core/Classes/Site/SiteFinder.php: public function getSiteByRootPageId(int $rootPageId): Site typo3/sysext/core/Classes/Site/SiteFinder.php: public function getSiteByIdentifier(string $identifier): Site typo3/sysext/core/Classes/Site/SiteFinder.php: public function getSiteByPageId(int $pageId, array $rootLine = null, string $mountPointParameter = null): Site typo3/sysext/core/Tests/Unit/Localization/LocalesTest.php: private function createSiteWithDefaultLanguage(string $locale): Site typo3/sysext/core/Tests/Unit/Site/Entity/SiteLanguageTest.php: private function createSiteWithLanguage(array $languageConfiguration): Site typo3/sysext/frontend/Classes/Event/FilterMenuItemsEvent.php: public function getSite(): Site typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTestTrait.php: private function createSiteWithLanguage(array $languageConfiguration): Site typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php: private function createSiteWithDefaultLanguage(array $languageConfiguration): Site typo3/sysext/frontend/Tests/Unit/Http/RequestHandlerTest.php: private function createSiteWithLanguage(): Site typo3/sysext/frontend/Tests/Unit/Plugin/AbstractPluginTest.php: private function createSiteWithDefaultLanguage(): Site git grep "Site \\$" typo3/sysext/backend/Tests/Functional/Form/FormDataProvider/TcaCategoryTest.php: public function addDataOverridesDefaultFieldConfigurationBySiteConfig(string $inputStartingPoints, string $expectedStartingPoints, Site $site): void typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php: public function addDataHandsSiteConfigurationOverToTableConfigurationTree(string $inputStartingPoints, array $expectedStartingPoints, Site $site): void typo3/sysext/core/Classes/Configuration/PageTsConfig.php: public function getWithUserOverride(int $pageId, array $rootLine, ?Site $site, ConditionMatcherInterface $conditionMatcher, BackendUserAuthentication $user = null): array typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php: * @param Site $site typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php: public function createAspects(array $aspects, SiteLanguage $language, Site $site): array typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php: * @param Site $site typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php: protected function enrich(AspectInterface $aspect, SiteLanguage $language, Site $site): AspectInterface typo3/sysext/core/Classes/Routing/PageRouter.php: * @param Site $site typo3/sysext/core/Classes/Routing/PageRouter.php: public function __construct(Site $site, Context $context = null) typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php: public function __construct(Context $context, Site $site, ?EnhancerFactory $enhancerFactory) typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php: * @param Site $siteOfMountedPage the site of the target page, which could be different from the current page typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php: Site $siteOfMountedPage, typo3/sysext/core/Classes/Site/SiteAwareInterface.php: * @param Entity\Site $site typo3/sysext/core/Classes/Site/SiteAwareInterface.php: public function setSite(Site $site): void; typo3/sysext/core/Documentation/Changelog/9.5.x/Important-88720-RespectSiteForPersistedMappers.rst:requires was extended with mandatory argument `\TYPO3\CMS\Core\Site\Entity\Site $site` typo3/sysext/core/Documentation/Changelog/9.5.x/Important-88720-RespectSiteForPersistedMappers.rst: public function createAspects(array $aspects, SiteLanguage $language, Site $site): array typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedAliasMapperTest.php: private function writeSiteConfiguration(Site $site): void typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedPatternMapperTest.php: private function writeSiteConfiguration(Site $site): void typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php: * @param Site $site the current site where the configuration is based on typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php: protected function getApplicableStaticRoute(array $staticRouteConfiguration, Site $site, string $uriPath): ?array typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php: * @param Site $site typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php: protected function getPageUri(ServerRequestInterface $request, Site $site, array $urlParams): string typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php: * @param Site $site typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php: protected function resolveByType(ServerRequestInterface $request, Site $site, string $type, array $routeConfig): array typo3/sysext/frontend/Classes/Middleware/TypoScriptFrontendInitialization.php: /** @var Site $site */ typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php: * @param Site $siteOfTargetPage typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php: protected function getSiteLanguageOfTargetPage(Site $siteOfTargetPage, string $targetLanguageId): SiteLanguage typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php: * @param Site $siteOfTargetPage typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php: protected function generateUrlForPageWithSiteConfiguration(array $page, Site $siteOfTargetPage, array $queryParameters, string $fragment, array $conf): UriInterface typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php: /** @var Site $site */ typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php: * @param Site $site typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php: Site $site, typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php: * @param Site $site typo3/sysext/frontend/Tests/Unit/Middleware/SiteBaseRedirectResolverTest.php: Site $site, typo3/sysext/frontend/Tests/Unit/Middleware/SiteResolverTest.php: /** @var Site $site */ typo3/sysext/redirects/Classes/Service/IntegrityService.php: private function getAllPageUrlsForSite(Site $site): array typo3/sysext/redirects/Classes/Service/IntegrityService.php: private function getSlugsOfSubPages(int $pageId, Site $site): array git grep "Site\[\]" typo3/sysext/backend/Tests/Unit/Configuration/TranslationConfigurationProviderTest.php: * @return Site[] typo3/sysext/core/Classes/Configuration/SiteConfiguration.php: * @return Site[] typo3/sysext/core/Classes/Configuration/SiteConfiguration.php: * @return Site[] typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedAliasMapperTest.php: * @var Site[] typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedPatternMapperTest.php: * @var Site[] And then we'd also need to have the following methods as part of the interface: `getRouter(?Context $context): RouterInterface` `getAllLanguages(): array` `getAttribute(string $attributeName): mixed` Maybe we could think about adding a PageRouterFactory, instead of moving getRouter(), Benni? Anyway, I will adapt those cases for now. -
Benjamin Franzke uploaded patch set 6 05/04/22, 07:41
-
core-ci voted on patch set 5 V -1 05/04/22, 07:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26790
-
core-ci voted on patch set 6 V +1 05/04/22, 07:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26793
-
Georg Ringer voted on patch set 6 V +1 CR +1 05/04/22, 08:22
-
Benni Mack commented on patch set 6 05/04/22, 08:56
Reply
Done -
Josef Glatz commented on patch set 6 V +1 05/04/22, 08:57
Reply
Done -
Benni Mack commented on patch set 6 CR -1 05/04/22, 09:01
tbh, there are reasons why there are places where "Site" is used instead of "SiteInterface" - so I think I need to verify each one of them. Changing type hints might have some ugly side-effects as well, I guess... need to check this. -
Benjamin Franzke commented on patch set 6 05/04/22, 12:02
Reply
Yea, that's true, changing return type declarations might cause issues for extended classes and return type declarations, other than that broader type declarations should be "safe". Would probably still be needed to mark this as BREAKING for the interface change. > "Site" is used instead of "SiteInterface" Yup, for that reasons I didn't change any `instanceof Site` to `instanceof SiteInterface`. -
Simon Schaufelberger rebased onto patch set 7 06/10/22, 11:34
-
core-ci voted on patch set 7 V +1 06/10/22, 11:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27915
-
Simon Schaufelberger voted on patch set 7 V +1 CR +1 06/19/22, 01:30
-
Oliver Klee commented on patch set 8 06/19/22, 07:55
Published edit on patch set 7. -
Oliver Klee voted on patch set 8 CR +1 06/19/22, 07:58
-
core-ci voted on patch set 8 V -1 06/19/22, 08:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28215
-
Oliver Klee commented on patch set 8 06/19/22, 09:02
This needs to be rebased. (The failure is unrelated and is solved by https://review.typo3.org/c/Packages/TYPO3.CMS/+/74871 .) -
Oliver Klee rebased onto patch set 9 06/19/22, 09:56
-
Oliver Klee voted on patch set 9 CR +1 06/19/22, 09:56
-
core-ci voted on patch set 9 V +1 06/19/22, 10:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28218
-
Simon Schaufelberger voted on patch set 9 CR +1 06/19/22, 11:19
-
Benni Mack commented on patch set 9 CR -1 06/20/22, 10:15
As mentioned in a comment above, there are certain times where a Site is expected (and if extension authors use it with NullSite it would be wrong). -
Oliver Klee commented on patch set 9 06/20/22, 10:24
Reply
Do you know which places these are? -
Simon Schaufelberger commented on patch set 9 08/19/22, 10:17
@Benni ping -
Benni Mack commented on patch set 9 08/19/22, 15:18
Reply Unresolved
Examples are: * TSFE (does not work with NullSite, only with real sites) * Page Link Builder * EXT:seo * Menu cObject * ContentObjectRenderer * EXT:core/Routing -
Stefan Froemken commented on patch set 9 CR -1 10/05/22, 08:50
With the Site to SiteInterface change we allow NullSite to be valid on much more places as expected. Modifying the NullSite object to be compatible somehow it the wrong approach. As Benni wrote: "use (working) with NullSite is wrong". Can we please revert the Site to SiteInterface change and focus to the real problem? -
Georg Ringer abandoned the change 01/13/23, 08:26
change is abandoned because of wrong implementation -
Simon Schaufelberger commented on patch set 9 01/13/23, 19:22
what do you mean by wrong implementation? why don't you make it right then?