Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Sep 24, 2020
2 parents 3c9d7a7 + 66ec95f commit 96b7d83
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 53 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
15 changes: 9 additions & 6 deletions Classes/Form/Field/Inline/Fal.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,23 @@ 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' => [
'cropVariants' => $this->cropVariants
]
];
}

return $configuration;
}

Expand Down
10 changes: 0 additions & 10 deletions Classes/Integration/HookSubscribers/ContentIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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';
}
}
8 changes: 3 additions & 5 deletions Classes/Integration/HookSubscribers/DataHandlerSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 3 additions & 21 deletions Classes/Integration/HookSubscribers/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Integration/HookSubscribers/WizardItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion Classes/Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion Classes/Service/PageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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;
Expand All @@ -248,6 +254,7 @@ public function getAvailablePageTemplateFiles()
}
}
}
$cache->set($cacheKey, $output);
return $output;
}

Expand Down
23 changes: 23 additions & 0 deletions Documentation/Changelog/9.4.2.md
Original file line number Diff line number Diff line change
@@ -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!*

File renamed without changes.
9 changes: 4 additions & 5 deletions Tests/Unit/Integration/HookSubscribers/PreviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'priority' => 'top',
'loadOrder' => '',
'module' => '',
'state' => 'stable',
'state' => 'beta',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
Expand Down

0 comments on commit 96b7d83

Please sign in to comment.