From 7bbace32ab6bfe715ed8f9a50afa6a66806abdd6 Mon Sep 17 00:00:00 2001 From: Rene Tobias Date: Mon, 12 Aug 2019 14:03:24 +0200 Subject: [PATCH] Upgraded to 9.5, migration ['TYPO3_DB'], fixing issue #9 - onehour offset --- Classes/Controller/NewsController.php | 2 +- Classes/Hooks/PageRenderer.php | 6 +- Classes/Utility/Div.php | 15 ++++- .../Javascript/CalendarViewHelper.php | 4 +- ext_emconf.php | 62 ++++++++++--------- ext_tables.php | 4 +- sonar-project.properties | 15 ----- 7 files changed, 55 insertions(+), 53 deletions(-) delete mode 100644 sonar-project.properties diff --git a/Classes/Controller/NewsController.php b/Classes/Controller/NewsController.php index 00a9b00..e807933 100644 --- a/Classes/Controller/NewsController.php +++ b/Classes/Controller/NewsController.php @@ -372,7 +372,7 @@ public function getTagsOfNews($newsRecords) */ public function ajaxEventAction(array $overwriteDemand = null) { - date_default_timezone_set('UTC'); + //date_default_timezone_set('UTC+1'); $calendarstart = \DateTime::createFromFormat('Y-m-d H:i:s', $this->request->getArgument('start') . '00:00:00'); $calendarend = \DateTime::createFromFormat('Y-m-d H:i:s', $this->request->getArgument('end') . '00:00:00'); diff --git a/Classes/Hooks/PageRenderer.php b/Classes/Hooks/PageRenderer.php index 2d893e2..39eba8e 100644 --- a/Classes/Hooks/PageRenderer.php +++ b/Classes/Hooks/PageRenderer.php @@ -26,7 +26,7 @@ */ class PageRenderer implements SingletonInterface { - + /** * wrapper function called by hook (\TYPO3\CMS\Core\Page\PageRenderer->render-preProcess) * @@ -37,7 +37,7 @@ class PageRenderer implements SingletonInterface */ public function addBackendJS($parameters, &$pageRenderer) { - if (get_class($GLOBALS['SOBE']) === 'TYPO3\CMS\Backend\Controller\EditDocumentController' && array_keys($GLOBALS['SOBE']->editconf)[0] === 'tx_news_domain_model_news') { + if (!empty($GLOBALS['SOBE']) && (get_class($GLOBALS['SOBE']) === 'TYPO3\CMS\Backend\Controller\EditDocumentController' && array_keys($GLOBALS['SOBE']->editconf)[0] === 'tx_news_domain_model_news')) { $lang = $GLOBALS['LANG']; $languageLabels = [ 'datedNews.modalHeader' => $lang->sL('LLL:EXT:dated_news/Resources/Private/Language/locallang_db.xml:tx_dated_news.modal.header', 1), @@ -47,7 +47,7 @@ public function addBackendJS($parameters, &$pageRenderer) 'datedNews.overwrite.allFieldsNoneModified' => $lang->sL('LLL:EXT:dated_news/Resources/Private/Language/locallang_db.xml:tx_dated_news.modal.overwrite.allFieldsNoneModified', 1), 'datedNews.overwrite.changedFieldsAll' => $lang->sL('LLL:EXT:dated_news/Resources/Private/Language/locallang_db.xml:tx_dated_news.modal.overwrite.changedFieldsAll', 1), 'datedNews.overwrite.changedFieldsNoneModified' => $lang->sL('LLL:EXT:dated_news/Resources/Private/Language/locallang_db.xml:tx_dated_news.modal.overwrite.changedFieldsNoneModified', 1), - + ]; $pageRenderer->addInlineLanguageLabelArray($languageLabels); $pageRenderer->loadRequireJsModule('TYPO3/CMS/DatedNews/Backend/ConfirmationDialog'); diff --git a/Classes/Utility/Div.php b/Classes/Utility/Div.php index c2d07fe..667cd04 100644 --- a/Classes/Utility/Div.php +++ b/Classes/Utility/Div.php @@ -23,6 +23,8 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Service\FlexFormService; +use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; /** * This file is part of the TYPO3 CMS project. @@ -214,9 +216,18 @@ public function shuffleAssoc($list) */ public function getPluginConfiguration($id) { - $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1; - $piFlexformSettings = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pi_flexform', 'tt_content', 'uid = ' . $id); + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content'); + $queryBuilder->select('pi_flexform') + ->from('tt_content') + ->where( + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)) + ); + + $piFlexformSettings = $queryBuilder->execute()->fetchAll(); + $ffs = GeneralUtility::makeInstance(FlexFormService::class); return $ffs->convertFlexFormContentToArray($piFlexformSettings[0]['pi_flexform']); + + } } diff --git a/Classes/ViewHelpers/Javascript/CalendarViewHelper.php b/Classes/ViewHelpers/Javascript/CalendarViewHelper.php index 9162be7..3238205 100644 --- a/Classes/ViewHelpers/Javascript/CalendarViewHelper.php +++ b/Classes/ViewHelpers/Javascript/CalendarViewHelper.php @@ -147,7 +147,7 @@ public function render() //complete javascript code $js = << 0) { var bottomContainerPos = $('#calendar')[0].getBoundingClientRect().bottom; diff --git a/ext_emconf.php b/ext_emconf.php index fd4eb40..e0bc602 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,36 +1,42 @@ 'Dated News', - 'description' => 'Extends the TYPO3 versatile news system extension tx_news with a calendar view using fullcalendar.js/qtip.js and allows to book for the now pricable events', - 'category' => 'fe', - 'author' => 'Falk Röder', - 'author_email' => 'mail@falk-roeder.de', - 'state' => 'stable', - 'internal' => '', - 'uploadfolder' => '0', - 'createDirs' => '', - 'clearCacheOnLoad' => 1, - 'version' => '5.1.1', - 'constraints' => [ - 'depends' => [ - 'typo3' => '7.6.13-8.7.99', - 'news' => '5.3.0-6.3.99', - 'recurr' => '1.0.0', - ], - 'conflicts' => [ - ], - 'suggests' => [ - ], - ], -]; +$EM_CONF[$_EXTKEY] = array ( + 'title' => 'Dated News', + 'description' => 'Extends the TYPO3 versatile news system extension tx_news with a calendar view using fullcalendar.js/qtip.js and allows to book for the now pricable events', + 'category' => 'fe', + 'author' => 'Falk Röder', + 'author_email' => 'mail@falk-roeder.de', + 'state' => 'stable', + 'uploadfolder' => false, + 'createDirs' => '', + 'clearCacheOnLoad' => 1, + 'version' => '6.0.0', + 'constraints' => + array ( + 'depends' => + array ( + 'typo3' => '8.0.0-9.5.99', + 'news' => '5.3.0-7.99.99', + 'recurr' => '1.0.0', + ), + 'conflicts' => + array ( + ), + 'suggests' => + array ( + ), + ), + 'clearcacheonload' => true, + 'author_company' => NULL, +); + diff --git a/ext_tables.php b/ext_tables.php index 2c8975e..922bbbe 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -9,7 +9,7 @@ \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_datednews_domain_model_newsrecurrence'); if (TYPO3_MODE == 'BE') { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Classes/Hooks/PageRenderer.php:FalkRoeder\\DatedNews\\Hooks\\PageRenderer->addBackendJS'; + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][] = 'FalkRoeder\\DatedNews\\Hooks\\PageRenderer->addBackendJS'; } //TYPO3 V7 @@ -23,4 +23,4 @@ ]; } -$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['orderByNews'] .= ',eventstart'; +$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['orderByNews'] .= ',eventstart'; \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 5e90d9b..0000000 --- a/sonar-project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# must be unique in a given SonarQube instance -sonar.projectKey=dated_news -# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. -sonar.projectName=Dated News -sonar.projectVersion=5.1.0 - -# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -# This property is optional if sonar.modules is set. -sonar.sources=. - -# Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8 - - -sonar.exclusions = Resources/Public/Plugins/**, Resources/Public/CSS/jqueryThemes/** \ No newline at end of file