TYPO3-CMS / styleguide

[READ-ONLY] Subtree split of the TYPO3 Core Extension "styleguide"
GNU General Public License v2.0
101 stars 62 forks source link

[BUGFIX] Be able to inject runtime cache into SiteFinder #409

Closed christophlehmann closed 8 months ago

christophlehmann commented 1 year ago

This is about the Exception in https://git.typo3.org/typo3/CI/cms/-/jobs/2335240

In SiteFinder.php line 87:

  [TYPO3\CMS\Core\Exception\SiteNotFoundException (1521668882)]  
  No site found for root page id 51                              

Exception trace:
  at /builds/typo3/CI/cms/typo3/sysext/core/Classes/Site/SiteFinder.php:87
 TYPO3\CMS\Core\Site\SiteFinder->getSiteByRootPageId() at /builds/typo3/CI/cms/vendor/typo3/cms-styleguide/Classes/TcaDataGenerator/AbstractGenerator.php:45
 TYPO3\CMS\Styleguide\TcaDataGenerator\AbstractGenerator->createSiteConfiguration() at /builds/typo3/CI/cms/vendor/typo3/cms-styleguide/Classes/TcaDataGenerator/Generator.php:127

In https://review.typo3.org/c/Packages/TYPO3.CMS/+/78311/19..21 I inject the runtime cache into SiteFinder and this makes acceptance tests fail.

This change helps, but it looks little odd to me and rather as a workaround. SiteFinder uses SiteConfiguration (a singleton), whose caches get resetted in \TYPO3\CMS\Core\Configuration\SiteConfiguration::write() when a new site is added.

lolli42 commented 8 months ago

Hey. We're about to merge this repo into the core monorepo. This change should be mad part of your https://review.typo3.org/c/Packages/TYPO3.CMS/+/78311/

christophlehmann commented 8 months ago

Its not necessary anymore. Thanks for closing it.