From c88f03ecae9847ba8c97a97748a09d60c6e99931 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Mon, 28 Aug 2023 16:52:03 +0200 Subject: [PATCH 1/8] [TASK] Set beta stability --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index 4ad8b8ca7..74b2c1250 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -10,7 +10,7 @@ 'priority' => 'top', 'loadOrder' => '', 'module' => '', - 'state' => 'stable', + 'state' => 'beta', 'uploadfolder' => 0, 'createDirs' => '', 'modify_tables' => '', From 847c283d4343d12c76c6ad9af931acd977cc13f4 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Mon, 28 Aug 2023 16:54:08 +0200 Subject: [PATCH 2/8] [TASK] Fix phpstan issue --- Configuration/TCA/Overrides/tt_content.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 15d610936..a309ad93c 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -60,6 +60,8 @@ * I judge this risk to be acceptably low enough that this stupid - but very effective - fallback-style loading * of Flux's content types when in CLI mode is acceptable. */ - \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\FluidTYPO3\Flux\Integration\Configuration\SpooledConfigurationApplicator::class)->processData(); + /** @var \FluidTYPO3\Flux\Integration\Configuration\SpooledConfigurationApplicator $applicator */ + $applicator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\FluidTYPO3\Flux\Integration\Configuration\SpooledConfigurationApplicator::class); + $applicator->processData(); } })(); From a2c920876313583a120eff0642c271e2c4df6b02 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Mon, 4 Sep 2023 14:34:14 +0200 Subject: [PATCH 3/8] [BUGFIX] Allow CacheService to function before cache table(s) exist --- Classes/CacheService.php | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Classes/CacheService.php diff --git a/Classes/CacheService.php b/Classes/CacheService.php new file mode 100644 index 000000000..2efa0593b --- /dev/null +++ b/Classes/CacheService.php @@ -0,0 +1,72 @@ +persistentCache = $persistentCache; + $this->transientCache = $transientCache; + } + + /** + * @return mixed|false + */ + public function getFromCaches(string ...$identifyingValues) + { + $cacheKey = $this->createCacheIdFromValues($identifyingValues); + try { + $fromTransient = $this->transientCache->get($cacheKey); + if ($fromTransient) { + return $fromTransient; + } + + $fromPersistent = $this->persistentCache->get($cacheKey); + if ($fromPersistent) { + $this->transientCache->set($cacheKey, $fromPersistent); + return $fromPersistent; + } + } catch (NoSuchCacheException | TableNotFoundException $exception) { + // Suppressed: operation without cache is allowed. + } + + return false; + } + + /** + * @param mixed $value + */ + public function setInCaches($value, bool $persistent, string ...$identifyingValues): void + { + $cacheKey = $this->createCacheIdFromValues($identifyingValues); + try { + $this->transientCache->set($cacheKey, $value); + if ($persistent) { + $this->persistentCache->set($cacheKey, $value); + } + } catch (NoSuchCacheException | TableNotFoundException $exception) { + // Suppressed: operation without cache is allowed. + } + } + + public function remove(string ...$identifyingValues): void + { + $cacheKey = $this->createCacheIdFromValues($identifyingValues); + $this->transientCache->remove($cacheKey); + $this->persistentCache->remove($cacheKey); + } + + protected function createCacheIdFromValues(array $identifyingValues): string + { + return 'flux-' . md5(serialize($identifyingValues)); + } +} From 0c200bca21c03bcc1aa33e4ec9c5a16496e9d27b Mon Sep 17 00:00:00 2001 From: Claus Due Date: Mon, 4 Sep 2023 14:36:52 +0200 Subject: [PATCH 4/8] [BUGFIX] Igore cache errors on cache entry removal --- Classes/CacheService.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Classes/CacheService.php b/Classes/CacheService.php index 2efa0593b..eb9b58ae5 100644 --- a/Classes/CacheService.php +++ b/Classes/CacheService.php @@ -60,9 +60,13 @@ public function setInCaches($value, bool $persistent, string ...$identifyingValu public function remove(string ...$identifyingValues): void { - $cacheKey = $this->createCacheIdFromValues($identifyingValues); - $this->transientCache->remove($cacheKey); - $this->persistentCache->remove($cacheKey); + try { + $cacheKey = $this->createCacheIdFromValues($identifyingValues); + $this->transientCache->remove($cacheKey); + $this->persistentCache->remove($cacheKey); + } catch (NoSuchCacheException | TableNotFoundException $exception) { + // Suppressed: operation without cache is allowed. + } } protected function createCacheIdFromValues(array $identifyingValues): string From 843526a2e4722d002254ea6e8be367d04e1e0e27 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Mon, 4 Sep 2023 16:14:10 +0200 Subject: [PATCH 5/8] [BUGFIX] Move misplaced class to correct folder --- Classes/CacheService.php | 76 -------------------------------- Classes/Service/CacheService.php | 42 ++++++++++++------ 2 files changed, 28 insertions(+), 90 deletions(-) delete mode 100644 Classes/CacheService.php diff --git a/Classes/CacheService.php b/Classes/CacheService.php deleted file mode 100644 index eb9b58ae5..000000000 --- a/Classes/CacheService.php +++ /dev/null @@ -1,76 +0,0 @@ -persistentCache = $persistentCache; - $this->transientCache = $transientCache; - } - - /** - * @return mixed|false - */ - public function getFromCaches(string ...$identifyingValues) - { - $cacheKey = $this->createCacheIdFromValues($identifyingValues); - try { - $fromTransient = $this->transientCache->get($cacheKey); - if ($fromTransient) { - return $fromTransient; - } - - $fromPersistent = $this->persistentCache->get($cacheKey); - if ($fromPersistent) { - $this->transientCache->set($cacheKey, $fromPersistent); - return $fromPersistent; - } - } catch (NoSuchCacheException | TableNotFoundException $exception) { - // Suppressed: operation without cache is allowed. - } - - return false; - } - - /** - * @param mixed $value - */ - public function setInCaches($value, bool $persistent, string ...$identifyingValues): void - { - $cacheKey = $this->createCacheIdFromValues($identifyingValues); - try { - $this->transientCache->set($cacheKey, $value); - if ($persistent) { - $this->persistentCache->set($cacheKey, $value); - } - } catch (NoSuchCacheException | TableNotFoundException $exception) { - // Suppressed: operation without cache is allowed. - } - } - - public function remove(string ...$identifyingValues): void - { - try { - $cacheKey = $this->createCacheIdFromValues($identifyingValues); - $this->transientCache->remove($cacheKey); - $this->persistentCache->remove($cacheKey); - } catch (NoSuchCacheException | TableNotFoundException $exception) { - // Suppressed: operation without cache is allowed. - } - } - - protected function createCacheIdFromValues(array $identifyingValues): string - { - return 'flux-' . md5(serialize($identifyingValues)); - } -} diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index b4386fbfe..eb9b58ae5 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -2,6 +2,8 @@ declare(strict_types=1); namespace FluidTYPO3\Flux\Service; +use Doctrine\DBAL\Exception\TableNotFoundException; +use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\SingletonInterface; @@ -22,15 +24,19 @@ public function __construct(FrontendInterface $persistentCache, FrontendInterfac public function getFromCaches(string ...$identifyingValues) { $cacheKey = $this->createCacheIdFromValues($identifyingValues); - $fromTransient = $this->transientCache->get($cacheKey); - if ($fromTransient) { - return $fromTransient; - } + try { + $fromTransient = $this->transientCache->get($cacheKey); + if ($fromTransient) { + return $fromTransient; + } - $fromPersistent = $this->persistentCache->get($cacheKey); - if ($fromPersistent) { - $this->transientCache->set($cacheKey, $fromPersistent); - return $fromPersistent; + $fromPersistent = $this->persistentCache->get($cacheKey); + if ($fromPersistent) { + $this->transientCache->set($cacheKey, $fromPersistent); + return $fromPersistent; + } + } catch (NoSuchCacheException | TableNotFoundException $exception) { + // Suppressed: operation without cache is allowed. } return false; @@ -42,17 +48,25 @@ public function getFromCaches(string ...$identifyingValues) public function setInCaches($value, bool $persistent, string ...$identifyingValues): void { $cacheKey = $this->createCacheIdFromValues($identifyingValues); - $this->transientCache->set($cacheKey, $value); - if ($persistent) { - $this->persistentCache->set($cacheKey, $value); + try { + $this->transientCache->set($cacheKey, $value); + if ($persistent) { + $this->persistentCache->set($cacheKey, $value); + } + } catch (NoSuchCacheException | TableNotFoundException $exception) { + // Suppressed: operation without cache is allowed. } } public function remove(string ...$identifyingValues): void { - $cacheKey = $this->createCacheIdFromValues($identifyingValues); - $this->transientCache->remove($cacheKey); - $this->persistentCache->remove($cacheKey); + try { + $cacheKey = $this->createCacheIdFromValues($identifyingValues); + $this->transientCache->remove($cacheKey); + $this->persistentCache->remove($cacheKey); + } catch (NoSuchCacheException | TableNotFoundException $exception) { + // Suppressed: operation without cache is allowed. + } } protected function createCacheIdFromValues(array $identifyingValues): string From d26fd1c91024150d4ec07fd71015c571e5f8be01 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Tue, 5 Sep 2023 14:41:21 +0200 Subject: [PATCH 6/8] [BUGFIX] Replace specific implementation of ConfigurationManager in addition to interface alias --- .../Integration/Overrides/ChimeraConfigurationManager.php | 5 ----- Configuration/Services.yaml | 4 ++++ ext_localconf.php | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Classes/Integration/Overrides/ChimeraConfigurationManager.php b/Classes/Integration/Overrides/ChimeraConfigurationManager.php index a2a12b06c..531eec252 100644 --- a/Classes/Integration/Overrides/ChimeraConfigurationManager.php +++ b/Classes/Integration/Overrides/ChimeraConfigurationManager.php @@ -6,7 +6,6 @@ use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager; use TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager; -use TYPO3\CMS\Extbase\Service\ExtensionService; class ChimeraConfigurationManager extends AbstractChimeraConfigurationManager { @@ -28,10 +27,6 @@ protected function initializeConcreteConfigurationManager(): void $this->frontendConfigurationManager = $frontendConfigurationManager; $this->backendConfigurationManager = $backendConfigurationManager; - - /** @var ExtensionService $extensionService */ - $extensionService = $this->container->get(ExtensionService::class); - $extensionService->injectConfigurationManager($this); } public function setRequest(ServerRequestInterface $request): void diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index c3a1432e7..914c6b495 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -46,6 +46,10 @@ services: public: true FluidTYPO3\Flux\Integration\HookSubscribers\StaticTypoScriptInclusion: public: true + FluidTYPO3\Flux\Integration\Overrides\ChimeraConfigurationManager: + public: true + FluidTYPO3\Flux\Integration\Overrides\LegacyChimeraConfigurationManager: + public: true FluidTYPO3\Flux\Integration\BackendLayoutRenderer: public: true autowire: false diff --git a/ext_localconf.php b/ext_localconf.php index 99a9450b7..9a269af40 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -97,6 +97,10 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Controller\Page\LocalizationController::class]['className'] = \FluidTYPO3\Flux\Integration\Overrides\LocalizationController::class; } + $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class]['className'] = version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0', '<') + ? \FluidTYPO3\Flux\Integration\Overrides\LegacyChimeraConfigurationManager::class + : \FluidTYPO3\Flux\Integration\Overrides\ChimeraConfigurationManager::class; + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \FluidTYPO3\Flux\Integration\HookSubscribers\DataHandlerSubscriber::class; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = From bcec0b0677b787bebde060a26d3317a6bbd4dc06 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Wed, 6 Sep 2023 14:23:35 +0200 Subject: [PATCH 7/8] [BUGFIX] Preserve virutal columns from ContentObject data References: #2131 --- Classes/Controller/AbstractFluxController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Classes/Controller/AbstractFluxController.php b/Classes/Controller/AbstractFluxController.php index ba99a7c14..544f5c311 100644 --- a/Classes/Controller/AbstractFluxController.php +++ b/Classes/Controller/AbstractFluxController.php @@ -549,11 +549,14 @@ public function getRecord(): array } $record = $contentObject->data; if ($record['_LOCALIZED_UID'] ?? false) { - $record = $this->recordService->getSingle( - (string) $this->getFluxTableName(), - '*', - $record['_LOCALIZED_UID'] - ) ?? $record; + $record = array_merge( + $record, + $this->recordService->getSingle( + (string) $this->getFluxTableName(), + '*', + $record['_LOCALIZED_UID'] + ) ?? $record + ); } return $record; } From 6d82c08e78e9c8f92cb59b3bebf558e628fe7fe5 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Wed, 6 Sep 2023 14:44:26 +0200 Subject: [PATCH 8/8] [DOC] Include issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 35 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 17 +++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..bb5b559bc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: 'BUG: foobar fails when baz' +labels: '' +assignees: '' + +--- + +**I have checked that the bug exists in the `dev-development` branch** +_Yes or no._ +If you're about to answer "no" here, it is your responsibility to check `dev-development` **before** opening a bug report! + +**I have checked that there are no already open issues or recently closed issues about this bug** +_Yes or no._ +If you're about to answer "no" here, it is your responsibility to first check the open and recently closed issues for potential duplicaates. + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..f46e2c7de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: 'Feature request: having foobar would be nice' +labels: '' +assignees: '' + +--- + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered or workarounds you currently have to use** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here.