diff --git a/CHANGELOG.md b/CHANGELOG.md index 465b0424a..ebe7b18a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -Latest release: 9.4.1 (2020/06/28) +Latest release: 9.4.2 (2020/09/24) All previous release change logs: +* [9.4.2 (2020/09/24)](Documentation/Changelog/9.4.2.md) [Full list of changes](https://github.com/FluidTYPO3/flux/compare/9.4.1...9.4.2) * [9.4.1 (2020/06/28)](Documentation/Changelog/9.4.1.md) [Full list of changes](https://github.com/FluidTYPO3/flux/compare/9.4.0...9.4.1) * [9.4.0 (2020/05/31)](Documentation/Changelog/9.4.0.md) [Full list of changes](https://github.com/FluidTYPO3/flux/compare/9.3.2...9.4.0) * [9.3.2 (2020/02/08)](Documentation/Changelog/9.3.2.md) [Full list of changes](https://github.com/FluidTYPO3/flux/compare/9.3.1...9.3.2) diff --git a/Classes/Form/Field/Inline/Fal.php b/Classes/Form/Field/Inline/Fal.php index 4c45e1179..d028373b9 100644 --- a/Classes/Form/Field/Inline/Fal.php +++ b/Classes/Form/Field/Inline/Fal.php @@ -168,13 +168,15 @@ public function buildConfiguration() { $configuration = $this->prepareConfiguration('inline'); $configuration['appearance']['createNewRelationLinkTitle'] = $this->getCreateNewRelationLinkTitle(); + + if (!isset($configuration['overrideChildTca'])) { + $configuration['overrideChildTca'] = ['columns' => []]; + } + if (!isset($configuration['overrideChildTca']['columns'])) { + $configuration['overrideChildTca']['columns'] = []; + } + $configuration['overrideChildTca']['types'] = $configuration['foreign_types']; if (!empty($this->cropVariants)) { - if (!isset($configuration['overrideChildTca'])) { - $configuration['overrideChildTca'] = ['columns' => []]; - } - if (!isset($configuration['overrideChildTca']['columns'])) { - $configuration['overrideChildTca']['columns'] = []; - } $configuration['overrideChildTca']['columns']['crop'] = [ 'config' => [ @@ -182,6 +184,7 @@ public function buildConfiguration() ] ]; } + return $configuration; } diff --git a/Classes/Integration/HookSubscribers/ContentIcon.php b/Classes/Integration/HookSubscribers/ContentIcon.php index 7b1d67646..42bcd5800 100644 --- a/Classes/Integration/HookSubscribers/ContentIcon.php +++ b/Classes/Integration/HookSubscribers/ContentIcon.php @@ -95,8 +95,6 @@ public function addSubIcon(array $parameters, $caller = null) return ''; } - $this->attachAssets(); - $provider = null; $icon = ''; $record = null === $record && 0 < $uid ? BackendUtility::getRecord($table, $uid) : $record; @@ -203,12 +201,4 @@ protected function detectFirstFlexTypeFieldInTableFromPossibilities($table, $fie } return null; } - - /** - * @return void - */ - protected function attachAssets() - { - $GLOBALS['TBE_STYLES']['stylesheet'] = 'EXT:flux/Resources/Public/css/flux.css'; - } } diff --git a/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php b/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php index 8e5f1247c..dbda8ca10 100644 --- a/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php +++ b/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php @@ -66,11 +66,9 @@ public function processDatamap_afterDatabaseOperations($command, $table, $id, $f $newColumnPosition = 0; if (!empty($fieldArray['l18n_parent'])) { - // Command was "localize", do not touch colPos. - return; - } - - if (isset(static::$copiedRecords[$originalParentUid])) { + // Command was "localize", read colPos value from the translation parent and use directly + $newColumnPosition = $this->getSingleRecordWithoutRestrictions($table, $fieldArray['l18n_parent'], 'colPos')['colPos']; + } elseif (isset(static::$copiedRecords[$originalParentUid])) { // The parent of the original version of the record that was copied, was also copied in the same request; // this means the record that was copied, was copied as a recursion operation. Look up the most recent copy // of the original record's parent and create a new column position number based on the new parent. diff --git a/Classes/Integration/HookSubscribers/Preview.php b/Classes/Integration/HookSubscribers/Preview.php index 173fb19a2..8fa54ec81 100755 --- a/Classes/Integration/HookSubscribers/Preview.php +++ b/Classes/Integration/HookSubscribers/Preview.php @@ -11,13 +11,10 @@ use FluidTYPO3\Flux\Provider\ProviderInterface; use FluidTYPO3\Flux\Service\FluxService; -use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\View\PageLayoutView; use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface; -use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\PathUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; /** @@ -69,24 +66,9 @@ public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerCo protected function attachAssets() { if (false === static::$assetsIncluded) { - $doc = GeneralUtility::makeInstance(ModuleTemplate::class); - $doc->backPath = $GLOBALS['BACK_PATH'] ?? ''; - - /** @var PageRenderer $pageRenderer */ - $pageRenderer = $doc->getPageRenderer(); - - $fullJsPath = PathUtility::getRelativePath( - defined('PATH_typo3') ? PATH_typo3 : Environment::getPublicPath(), - GeneralUtility::getFileAbsFileName('EXT:flux/Resources/Public/js/') - ); - - // requirejs - $pageRenderer->addRequireJsConfiguration([ - 'paths' => [ - 'FluidTypo3/Flux/FluxCollapse' => $fullJsPath . 'fluxCollapse', - ], - ]); - $pageRenderer->loadRequireJsModule('FluidTypo3/Flux/FluxCollapse'); + $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); + $pageRenderer->addCssFile('EXT:flux/Resources/Public/css/flux.css'); + $pageRenderer->loadRequireJsModule('TYPO3/CMS/Flux/FluxCollapse'); static::$assetsIncluded = true; } diff --git a/Classes/Integration/HookSubscribers/WizardItems.php b/Classes/Integration/HookSubscribers/WizardItems.php index 5eabf3db2..cafb9c2a4 100644 --- a/Classes/Integration/HookSubscribers/WizardItems.php +++ b/Classes/Integration/HookSubscribers/WizardItems.php @@ -99,7 +99,7 @@ public function manipulateWizardItems(&$items, &$parentObject) $pageUid = 0; if (class_exists(SiteFinder::class)) { $dataArray = GeneralUtility::_GET('defVals')['tt_content'] ?? []; - $pageUid = (int) (key($dataArray) ?? ObjectAccess::getProperty($parentObject, 'id', true)); + $pageUid = (int) (key($dataArray) ?? GeneralUtility::_GET('id') ?? ObjectAccess::getProperty($parentObject, 'id', true)); if ($pageUid > 0) { try { $enabledContentTypes = []; @@ -131,7 +131,7 @@ protected function filterPermittedFluidContentTypesByInsertionPosition(array $it { list ($whitelist, $blacklist) = $this->getWhiteAndBlackListsFromPageAndContentColumn( $pageUid, - (int) ($dataArray['colPos'] ?? ObjectAccess::getProperty($parentObject, 'colPos', true)) + (int) ($dataArray['colPos'] ?? GeneralUtility::_GET('colPos') ?? ObjectAccess::getProperty($parentObject, 'colPos', true)) ); $overrides = HookHandler::trigger( HookHandler::ALLOWED_CONTENT_RULES_FETCHED, diff --git a/Classes/Provider/AbstractProvider.php b/Classes/Provider/AbstractProvider.php index dd6741d1f..be15b663c 100644 --- a/Classes/Provider/AbstractProvider.php +++ b/Classes/Provider/AbstractProvider.php @@ -280,7 +280,9 @@ protected function getViewVariables(array $row) */ public function getForm(array $row) { - return $this->form ?? $this->createCustomFormInstance($row) ?? $this->extractConfiguration($row, 'form'); + $form = $this->form ?? $this->createCustomFormInstance($row) ?? $this->extractConfiguration($row, 'form'); + $form->setOption(Form::OPTION_RECORD, $row); + return $form; } /** diff --git a/Classes/Service/PageService.php b/Classes/Service/PageService.php index b3867d051..27ae4a661 100755 --- a/Classes/Service/PageService.php +++ b/Classes/Service/PageService.php @@ -194,6 +194,12 @@ public function getPageFlexFormSource($pageUid) */ public function getAvailablePageTemplateFiles() { + $cache = $this->getRuntimeCache(); + $cacheKey = 'page_templates'; + $fromCache = $cache->get($cacheKey); + if ($fromCache) { + return $fromCache; + } $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); $typoScript = $this->configurationService->getPageConfiguration(); $output = []; @@ -226,7 +232,7 @@ public function getAvailablePageTemplateFiles() if (false === $form instanceof Form) { $logger->log( - 'fatal', + 'error', 'Template file ' . $file . ' contains an unparsable Form definition' ); continue; @@ -248,6 +254,7 @@ public function getAvailablePageTemplateFiles() } } } + $cache->set($cacheKey, $output); return $output; } diff --git a/Documentation/Changelog/9.4.2.md b/Documentation/Changelog/9.4.2.md new file mode 100644 index 000000000..4097786e0 --- /dev/null +++ b/Documentation/Changelog/9.4.2.md @@ -0,0 +1,23 @@ +## Release: 9.4.2 (2020/09/24) + +* 2020-09-12 [BUGFIX] Fix collapse script integration (#1829) (Commit 16d8f9b8 by Claus Due) +* 2020-09-12 [BUGFIX] Read page UID and colPos from request arguments (Commit b7955ac3 by Claus Due) +* 2020-09-12 [BUGFIX] Store resolved page forms in runtime cache (#1828) (Commit 7be5bcdb by Claus Due) +* 2020-09-12 [BUGFIX] Change non existing error level 'fatal' to 'error' (#1827) (Commit 20999a2b by JM) +* 2020-08-19 [BUGFIX] Adjust colPos for recursively localized child content (Commit 5909eb07 by Claus Due) +* 2020-08-19 [BUGFIX] Ensure record is assigned to form (Commit db567cce by Claus Due) +* 2020-08-14 [BUGFIX] Bring back Crop Variants (#1817) (Commit 8559efb5 by JM) +* 2020-06-28 [BUGFIX] Fix flux:field.custom and flux:field.userFunc (Commit b3fec532 by Claus Due) + +Generated by: + +``` +git log --since="2020/06/28" --until="2020/09/24" --abbrev-commit --pretty='%ad %s (Commit %h by %an)' \ + --date=short | egrep '(\[FEATURE|BUGFIX|REMOVAL\])+'` +``` + +Full list of changes: https://github.com/FluidTYPO3/flux/compare/9.4.1...9.4.2 + +*Please note: the change list above does not contain any TASK commits since they are considered +infrastructure-only and not relevant to end users. The full list includes these!* + diff --git a/Resources/Public/js/fluxCollapse.js b/Resources/Public/JavaScript/FluxCollapse.js similarity index 100% rename from Resources/Public/js/fluxCollapse.js rename to Resources/Public/JavaScript/FluxCollapse.js diff --git a/Tests/Unit/Integration/HookSubscribers/PreviewTest.php b/Tests/Unit/Integration/HookSubscribers/PreviewTest.php index 7f19b4faa..ae8fc3dc6 100644 --- a/Tests/Unit/Integration/HookSubscribers/PreviewTest.php +++ b/Tests/Unit/Integration/HookSubscribers/PreviewTest.php @@ -63,13 +63,12 @@ protected function callUserFunction($function, $caller) */ public function testAttachAssets() { - $pageRenderer = $this->getMockBuilder(PageRenderer::class)->setMethods(['addRequireJsConfiguration', 'loadRequireJsModule'])->getMock(); - $pageRenderer->expects($this->atLeastOnce())->method('addRequireJsConfiguration'); + $pageRenderer = $this->getMockBuilder(PageRenderer::class)->setMethods(['loadRequireJsModule'])->getMock(); $pageRenderer->expects($this->atLeastOnce())->method('loadRequireJsModule'); - $document = $this->getMockBuilder(ModuleTemplate::class)->setMethods(['getPageRenderer'])->getMock(); - $document->expects($this->once())->method('getPageRenderer')->willReturn($pageRenderer); - GeneralUtility::addInstance(ModuleTemplate::class, $document); + $instances = GeneralUtility::getSingletonInstances(); + GeneralUtility::setSingletonInstance(PageRenderer::class, $pageRenderer); $subject = $this->createInstance(); $this->callInaccessibleMethod($subject, 'attachAssets'); + GeneralUtility::resetSingletonInstances($instances); } } diff --git a/ext_emconf.php b/ext_emconf.php index 8341b5c5f..2865df54f 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' => '',