Skip to content

Commit

Permalink
Merge pull request #400 from t3solution/5.3.13
Browse files Browse the repository at this point in the history
Bugfix release v5.3.13
  • Loading branch information
t3solution authored Aug 11, 2024
2 parents fe11435 + 242e987 commit 9c76d14
Show file tree
Hide file tree
Showing 65 changed files with 11,882 additions and 12,294 deletions.
8 changes: 6 additions & 2 deletions Classes/Backend/EventListener/FlexForm/FlexformEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ public function __invoke(AfterFlexFormDataStructureParsedEvent $event): void
$dataStructure = $event->getDataStructure();
$identifier = $event->getIdentifier();

$ffPath = Environment::getPublicPath() . '/fileadmin/T3SB/FlexForms/';
if (!empty($settings['sitepackage'])) {
$ffPath = 'EXT:t3sb_package/T3SB/FlexForms/';
} else {
$ffPath = '/fileadmin/T3SB/FlexForms/';
}

foreach ($GLOBALS['TCA']['tt_content']['columns']['tx_t3sbootstrap_flexform']['config']['ds'] as $key=>$flexForm) {
$flexForms[$key] = substr($flexForm, 46, -4);
Expand All @@ -43,7 +47,7 @@ public function __invoke(AfterFlexFormDataStructureParsedEvent $event): void
if (array_key_exists($identifier['dataStructureKey'], $flexForms)) {
if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content'
&& $identifier['fieldName'] === 'tx_t3sbootstrap_flexform' && $identifier['dataStructureKey']) {
$file = $ffPath.$flexForms[$identifier['dataStructureKey']].'.xml';
$file = Environment::getPublicPath() . $ffPath.$flexForms[$identifier['dataStructureKey']].'.xml';
if (file_exists($file)) {
$content = @file_get_contents($file);
if ($content) {
Expand Down
21 changes: 5 additions & 16 deletions Classes/Components/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,13 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
$btnDropdownItem = [];
if (!empty($flexconf['dropdownItems']) && is_array($flexconf['dropdownItems'])) {
$processedData['dropdowndirection'] = !empty($flexconf['direction']) ? ' '.$flexconf['direction'] : '';

foreach ($flexconf['dropdownItems'] as $key=>$dropdownItem) {
$dIarray = explode(' ', $dropdownItem['list']['group']);
if (str_contains($dropdownItem['list']['group'], '"')) {
// if title have more than one word
$btnDropdownItem[$key]['link'] = $dIarray[0];
$btnDropdownItem[$key]['target'] = $dIarray[1] != '-' ? $dIarray[1] : '';
$btnDropdownItem[$key]['class'] = !empty($dIarray[2]) && $dIarray[2] != '-' ? $dIarray[2] : '';
$btnDropdownItem[$key]['title'] = !empty($dIarray[3]) && $dIarray[3] != '-' ? str_replace('"', '', $dIarray[3].' '.$dIarray[4]) : 'no tilte';
$btnDropdownItem[$key]['param'] = !empty($dIarray[5]) ? $dIarray[5] : '';
} else {
$btnDropdownItem[$key]['link'] = $dIarray[0];
$btnDropdownItem[$key]['target'] = !empty($dIarray[1]) && $dIarray[1] != '-' ? $dIarray[1] : '';
$btnDropdownItem[$key]['class'] = !empty($dIarray[2]) && $dIarray[2] != '-' ? $dIarray[2] : '';
$btnDropdownItem[$key]['title'] = !empty($dIarray[3]) && $dIarray[3] != '-' ? $dIarray[3] : 'no title';
$btnDropdownItem[$key]['param'] = !empty($dIarray[4]) ? $dIarray[4] : '';
}
$btnDropdownItem[$key]['link'] = $dropdownItem['list']['group'];
$btnDropdownItem[$key]['target'] = explode('=', $dropdownItem['list']['group'])[1];
}
}
$processedData['dropdownItems'] = !empty($btnDropdownItem) ? $btnDropdownItem : '';
$processedData['dropdownItems'] = !empty($btnDropdownItem) ? $btnDropdownItem : [];
$outline = !empty($flexconf['outline']) ? 'outline-' : '';
$style = !empty($flexconf['style']) ? $flexconf['style'] : '';
$typolinkButtonClass = ' btn btn-'.$outline.$style;
Expand Down Expand Up @@ -97,4 +85,5 @@ public function getProcessedData(array $processedData, array $flexconf, array $p

return $processedData;
}

}
4 changes: 2 additions & 2 deletions Classes/Components/Carousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
public function getCarouselCaptionStyle( $flexconf, $animate ): string
{
$style = '';
if ($flexconf['bgOverlay'] == 'caption') {
if (!empty($flexconf['bgOverlay']) && $flexconf['bgOverlay'] == 'caption') {
$captionStyle = ' top:0; left:15%; right:15%; bottom:0;';
$captionStyle .= $flexconf['captionVAlign'] == 'top' ? ' bottom:inherit;' : '';
$captionStyle .= $flexconf['captionVAlign'] == 'end' ? ' padding-bottom:50px;' : '';

} elseif ($flexconf['bgOverlay'] == 'image') {
} elseif (!empty($flexconf['bgOverlay']) && $flexconf['bgOverlay'] == 'image') {
$captionStyle = ' top:0; left:0; right:0; bottom:0;';
$captionStyle .= $flexconf['captionVAlign'] == 'end' ? ' padding-bottom:50px;' : '';
} else {
Expand Down
10 changes: 7 additions & 3 deletions Classes/ContentElements/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class Menu implements SingletonInterface
*/
public function getProcessedData(array $processedData, array $flexconf, string $cType): array
{
$processedData['menudirection'] = ' '.$flexconf['menudirection'];
$processedData['menudirection'] = !empty($flexconf['menudirection']) ? ' '.$flexconf['menudirection'] : null;
$processedData['menupills'] = !empty($flexconf['menupills']) ? ' nav-pills' :'';
if (!empty($flexconf['menudirection']) && $flexconf['menudirection'] == 'flex-row') {
if ($processedData['menudirection'] == ' flex-row') {
$processedData['menuHorizontalAlignment'] = !empty($flexconf['menuHorizontalAlignment'])
? ' '.$flexconf['menuHorizontalAlignment'] : ' justify-content-end';
}
Expand All @@ -33,7 +33,11 @@ public function getProcessedData(array $processedData, array $flexconf, string $
$processedData['pageLink'] = TRUE;
} else {
// if current page is selected
$frontendController = self::getFrontendController();
$request = $GLOBALS['TYPO3_REQUEST'];
$frontendController = $request->getAttribute('frontend.controller');
if (!$frontendController) {
$frontendController = self::getFrontendController();
}
if ( $frontendController->id == $processedData['data']['pid'] ) {
$processedData['onlyCurrentPageSelected'] = TRUE;
} else {
Expand Down
9 changes: 5 additions & 4 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function initializeAction(): void
$this->isSiteroot = $this->rootPageId === $this->currentUid ? true : false;
$this->tcaColumns = $GLOBALS['TCA']['tx_t3sbootstrap_domain_model_config']['columns'];
$this->isAdmin = $GLOBALS['BE_USER']->isAdmin();
$this->configRepository = GeneralUtility::makeInstance(ConfigRepository::class);
$this->rootConfig = $this->configRepository->findOneByPid($this->rootPageId);
$this->configRepository = GeneralUtility::makeInstance(ConfigRepository::class);
$this->rootConfig = $this->configRepository->findOneBy(['pid' => $this->rootPageId]);
$this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
Expand Down Expand Up @@ -277,7 +277,7 @@ protected function writeConstants(): void

$this->persistenceManager->persistAll();
if ($this->countRootTemplates) {
$configRepository = $this->configRepository->findOneByPid($this->rootPageId);
$configRepository = $this->configRepository->findOneBy(['pid' => $this->rootPageId]);
$navbarBreakpoint = $configRepository->getNavbarBreakpoint();
$breakpointWidth = $navbarBreakpoint == 'no' ? '' : $this->settings['breakpoint'][$navbarBreakpoint];
$siteroots = [];
Expand Down Expand Up @@ -592,10 +592,11 @@ protected function getTreeList($id, $depth, $begin = 0, $permsClause = ''): stri
QueryHelper::stripLogicalOperatorPrefix($permsClause)
)
->executeQuery();
while ($row = $statement->fetch()) {
while ($row = $statement->fetchAssociative()) {
if ($begin <= 0) {
$theList .= ',' . $row['uid'];
}

if ($depth > 1) {
$theSubList = self::getTreeList($row['uid'], $depth - 1, $begin - 1, $permsClause);
if (!empty($theList) && !empty($theSubList) && ($theSubList[0] !== ',')) {
Expand Down
39 changes: 19 additions & 20 deletions Classes/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ public function listAction(bool $deleted = false, bool $created = false, bool $u
if ($this->countRootTemplates === 0) {
$assignedOptions['rootTemplate'] = false;
}
$assignedOptions['rootConfig'] = $this->rootConfig ? true : false;
$assignedOptions['config'] = $this->configRepository->findOneByPid($this->currentUid);
$assignedOptions['rootConfig'] = $this->rootConfig ? true : false;
$assignedOptions['config'] = $this->configRepository->findOneBy(['pid' => $this->currentUid]);
$assignedOptions['admin'] = $this->isAdmin;
$assignedOptions['customScss'] = false;
$assignedOptions['scss'] = '';
$assignedOptions['action'] = 'list';
$assignedOptions['updateScss'] = $updateSss;
$assignedOptions['deleted'] = $deleted;
$assignedOptions['created'] = $created;
$assignedOptions['cdnHint'] = $cdnHint;
$assignedOptions['settings'] = $this->settings;

if (!empty($this->settings['customScss']) && (int)$this->settings['customScss'] === 1) {
$customScss = parent::getCustomScss('custom-variables');
Expand Down Expand Up @@ -124,11 +124,9 @@ public function listAction(bool $deleted = false, bool $created = false, bool $u
copy($orig_raster, $new_raster);
}

$this->view->assignMultiple($assignedOptions);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->assignMultiple($assignedOptions);
$moduleTemplate->setContent($this->view->render());
return $this->htmlResponse($moduleTemplate->renderContent());
return $moduleTemplate->renderResponse('Config/List');
}


Expand All @@ -149,8 +147,8 @@ public function newAction(): ResponseInterface
if (count($rootLineArray) > 1) {
unset($rootLineArray[count($rootLineArray)-1]);
}
foreach ($rootLineArray as $rootline) {
$rootlineConfig = $this->configRepository->findOneByPid((int)$rootline['uid']);
foreach ($rootLineArray as $rootline) {
$rootlineConfig = $this->configRepository->findOneBy(['pid' => (int)$rootline['uid']]);
if (!empty($rootlineConfig)) {
break;
}
Expand All @@ -166,11 +164,11 @@ public function newAction(): ResponseInterface
$newConfig = parent::setDefaults($newConfig);
$assignedOptions['newConfig'] = $newConfig;
}
$assignedOptions['settings'] = $this->settings;

$this->view->assignMultiple($assignedOptions);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());
return $this->htmlResponse($moduleTemplate->renderContent());
$moduleTemplate->assignMultiple($assignedOptions);
return $moduleTemplate->renderResponse('Config/Edit');
}


Expand Down Expand Up @@ -201,6 +199,7 @@ public function editAction(Config $config, bool $updated = false): ResponseInter
$assignedOptions['updated'] = $updated;
$assignedOptions['override'] = parent::overrideConfig();
$assignedOptions['tcaColumns'] = parent::getTcaColumns();
$assignedOptions['settings'] = $this->settings;
$assignedOptions['action'] = 'edit';
if (!$this->isSiteroot) {
$assignedOptions['compare'] = parent::compareConfig($config);
Expand All @@ -218,10 +217,9 @@ public function editAction(Config $config, bool $updated = false): ResponseInter
$notificationQueue->enqueue($flashMessage);
}

$this->view->assignMultiple($assignedOptions);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());
return $this->htmlResponse($moduleTemplate->renderContent());
$moduleTemplate->assignMultiple($assignedOptions);
return $moduleTemplate->renderResponse('Config/Edit');
}


Expand Down Expand Up @@ -265,11 +263,11 @@ public function dashboardAction(): ResponseInterface
$assignedOptions['action'] = 'dashboard';
$assignedOptions['isSiteroot'] = $this->isSiteroot;
$assignedOptions['admin'] = $this->isAdmin;
$assignedOptions['settings'] = $this->settings;

$this->view->assignMultiple($assignedOptions);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());
return $this->htmlResponse($moduleTemplate->renderContent());
$moduleTemplate->assignMultiple($assignedOptions);
return $moduleTemplate->renderResponse('Config/Dashboard');
}


Expand Down Expand Up @@ -307,10 +305,11 @@ public function constantsAction(): ResponseInterface
$assignedOptions['action'] = 'constants';
$assignedOptions['isSiteroot'] = $this->isSiteroot;
$assignedOptions['admin'] = $this->isAdmin;
$assignedOptions['settings'] = $this->settings;

$this->view->assignMultiple($assignedOptions);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());
return $this->htmlResponse($moduleTemplate->renderContent());
$moduleTemplate->assignMultiple($assignedOptions);
return $moduleTemplate->renderResponse('Config/Constants');

}
}
2 changes: 1 addition & 1 deletion Classes/DataProcessing/ConfigProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ protected function getTreeList(int $id, int $depth, int $begin = 0, string $perm
QueryHelper::stripLogicalOperatorPrefix($permsClause)
)
->executeQuery();
while ($row = $statement->fetch()) {
while ($row = $statement->fetchAssociative()) {
if ($begin <= 0) {
$theList .= ',' . $row['uid'];
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/DataProcessing/LastModifiedProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected function getPageTitle($uid): string
$queryBuilder->expr()->eq('doktype', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT))
)
->executeQuery()
->fetch();
->fetchAssociative();

$pageTitle = !empty($result['nav_title']) ? $result['nav_title'] : '';
}
Expand Down
9 changes: 5 additions & 4 deletions Classes/ExpressionLanguage/T3sbConditionFunctionsProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,17 @@ protected function getColPosList(): ExpressionFunction

if ($_GET['id'] ?? 0 && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
$pid = (int)$_GET['id'];
$configRepository = GeneralUtility::makeInstance(ConfigRepository::class);
$config = $configRepository->findOneByPid($pid);
$configRepository = GeneralUtility::makeInstance(ConfigRepository::class);
$config = $configRepository->findOneBy(['pid' => $pid]);

if (empty($config) && is_array($arguments['tree']->rootLineIds)) {
$rootLineIdsArray = array_reverse($arguments['tree']->rootLineIds);
unset($rootLineIdsArray[count($rootLineIdsArray)-1]);
unset($rootLineIdsArray[0]);

foreach ($rootLineIdsArray as $id) {
$config = $configRepository->findOneByPid($id);
foreach ($rootLineIdsArray as $id) {
$config = $configRepository->findOneBy(['pid' => $id]);

if (!empty($config)) {
break;
}
Expand Down
35 changes: 1 addition & 34 deletions Classes/Helper/ClassHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,7 @@ public function getDefaultClass(array $data, array $flexconf, string $cTypeClass

// Layout
if (!empty($data['layout'])) {
$pagesTSconfig = self::getFrontendController()->getPagesTSconfig();
$layout = $data['layout'];
$layoutAddItems = '';
$layoutClasses = '';
$layoutAltLabels = '';

if (!empty($pagesTSconfig['TCEFORM.']['tt_content.']['layout.']['addItems.'])) {
$layoutAddItems = $pagesTSconfig['TCEFORM.']['tt_content.']['layout.']['addItems.'];
}
if (!empty($pagesTSconfig['TCEFORM.']['tt_content.']['layout.']['classes.'])) {
$layoutClasses = $pagesTSconfig['TCEFORM.']['tt_content.']['layout.']['classes.'];
}
if (!empty($pagesTSconfig['TCEFORM.']['tt_content.']['layout.']['altLabels.'])) {
$layoutAltLabels = $pagesTSconfig['TCEFORM.']['tt_content.']['layout.']['altLabels.'];
}

if (!empty($layoutAddItems) && $layoutAddItems === $layout) {
$class .= ' layout-'.$layout;
} elseif (isset($layoutAltLabels) && !empty($layoutAltLabels[$layout])) {
if (isset($layoutClasses) && $layoutClasses[$layout]) {
$class .= ' '.strtolower($layoutClasses[$layout]);
} else {
$class .= ' layout-'.str_replace(' ', '-', strtolower($layoutAltLabels[$layout]));
}
} else {
$class .= ' layout-'.$layout;
}
$class .= ' layout-'.$data['layout'];
}
// Frame class
if ($data['frame_class'] != 'default') {
Expand Down Expand Up @@ -337,11 +311,4 @@ public function getContainerClass(array $parentflexconf, array $flexconf): strin
}


/**
* Returns the frontend controller
*/
protected function getFrontendController(): TypoScriptFrontendController
{
return $GLOBALS['TSFE'];
}
}
Loading

0 comments on commit 9c76d14

Please sign in to comment.