From 19b7fff24f2810e1f08972686eded4052400266e Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 11 May 2023 08:15:25 +0200 Subject: [PATCH] Remove v12 upgrade findings Ignore false positives for extension scanner. Migrate TCA and keep old v11 within condition for backwards compatibility. Relates: #110 --- Classes/Domain/Repository/Pageview.php | 1 + Classes/Domain/Repository/Recordview.php | 1 + Configuration/TCA/tx_tracking_pageview.php | 23 ++++++++++++++------ Configuration/TCA/tx_tracking_recordview.php | 17 ++++++++++----- Documentation/Changelog/2.5.1.rst | 9 +++++--- Documentation/Index.rst | 1 + Documentation/Maintenance.rst | 14 ++++++++++++ Documentation/Maintenance/v11.rst | 8 +++++++ 8 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 Documentation/Maintenance.rst create mode 100644 Documentation/Maintenance/v11.rst diff --git a/Classes/Domain/Repository/Pageview.php b/Classes/Domain/Repository/Pageview.php index 79b4f3b..75c8104 100644 --- a/Classes/Domain/Repository/Pageview.php +++ b/Classes/Domain/Repository/Pageview.php @@ -107,6 +107,7 @@ private function getFieldsFromModel(Model $pageview): array 'crdate' => $pageview->getCrdate()->format('U'), 'tstamp' => $pageview->getCrdate()->format('U'), 'type' => $pageview->getPageType(), + // @extensionScannerIgnoreLine 'sys_language_uid' => $pageview->getLanguage()->getLanguageId(), 'url' => $pageview->getUrl(), 'user_agent' => $pageview->getUserAgent(), diff --git a/Classes/Domain/Repository/Recordview.php b/Classes/Domain/Repository/Recordview.php index 15edb4f..0849dd8 100644 --- a/Classes/Domain/Repository/Recordview.php +++ b/Classes/Domain/Repository/Recordview.php @@ -53,6 +53,7 @@ private function getFieldsFromModel(Model $recordview): array 'pid' => $recordview->getPageUid(), 'crdate' => $recordview->getCrdate()->format('U'), 'tstamp' => $recordview->getCrdate()->format('U'), + // @extensionScannerIgnoreLine 'sys_language_uid' => $recordview->getLanguage()->getLanguageId(), 'url' => $recordview->getUrl(), 'user_agent' => $recordview->getUserAgent(), diff --git a/Configuration/TCA/tx_tracking_pageview.php b/Configuration/TCA/tx_tracking_pageview.php index 834b6fc..7a70688 100644 --- a/Configuration/TCA/tx_tracking_pageview.php +++ b/Configuration/TCA/tx_tracking_pageview.php @@ -1,6 +1,6 @@ [ 'label' => 'url', 'label_alt' => 'crdate', @@ -8,7 +8,6 @@ 'default_sortby' => 'crdate DESC', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'title' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview', @@ -32,9 +31,7 @@ 'crdate' => [ 'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview.crdate', 'config' => [ - 'type' => 'input', - 'eval' => 'datetime', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', ], ], 'sys_language_uid' => [ @@ -58,9 +55,8 @@ 'type' => [ 'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview.type', 'config' => [ - 'type' => 'input', + 'type' => 'number', 'readOnly' => true, - 'eval' => 'int', ], ], 'url' => [ @@ -73,3 +69,16 @@ ], ], ]; + +if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() < 12) { + $tca['ctrl']['cruser_id'] = 'cruser_id'; + + $tca['columns']['crdate']['config']['type'] = 'input'; + $tca['columns']['crdate']['config']['renderType'] = 'inputDateTime'; + $tca['columns']['crdate']['config']['eval'] = 'datetime'; + + $tca['columns']['type']['config']['type'] = 'input'; + $tca['columns']['type']['config']['eval'] = 'int'; +} + +return $tca; diff --git a/Configuration/TCA/tx_tracking_recordview.php b/Configuration/TCA/tx_tracking_recordview.php index 145ffa5..feca156 100644 --- a/Configuration/TCA/tx_tracking_recordview.php +++ b/Configuration/TCA/tx_tracking_recordview.php @@ -1,6 +1,6 @@ [ 'label' => 'record', 'label_alt' => 'crdate', @@ -8,7 +8,6 @@ 'default_sortby' => 'crdate DESC', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'title' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.recordview', @@ -32,9 +31,7 @@ 'crdate' => [ 'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.recordview.crdate', 'config' => [ - 'type' => 'input', - 'eval' => 'datetime', - 'renderType' => 'inputDateTime', + 'type' => 'inputDateTime', ], ], 'sys_language_uid' => [ @@ -75,3 +72,13 @@ ], ], ]; + +if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() < 12) { + $tca['ctrl']['cruser_id'] = 'cruser_id'; + + $tca['columns']['crdate']['config']['type'] = 'input'; + $tca['columns']['crdate']['config']['renderType'] = 'inputDateTime'; + $tca['columns']['crdate']['config']['eval'] = 'datetime'; +} + +return $tca; diff --git a/Documentation/Changelog/2.5.1.rst b/Documentation/Changelog/2.5.1.rst index c0bcc5e..c42b737 100644 --- a/Documentation/Changelog/2.5.1.rst +++ b/Documentation/Changelog/2.5.1.rst @@ -1,4 +1,4 @@ -2.6.0 +2.5.1 ===== Breaking @@ -9,8 +9,6 @@ Nothing Features -------- -Nothing - Fixes ----- @@ -27,6 +25,11 @@ Tasks * Migrate test fixtures to PHP Data Sets using `codappix/typo3-php-datasets `_ +* Remove false positives of extension scanner in v12. + +* Remove TCA migrations in v12. + Stay compatible with v11 via condition within code. + Deprecation ----------- diff --git a/Documentation/Index.rst b/Documentation/Index.rst index 80225d0..4b3428b 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -90,4 +90,5 @@ in order to extract further information from them with future updates. Installation Pageview Recordview + Maintenance Changelog diff --git a/Documentation/Maintenance.rst b/Documentation/Maintenance.rst new file mode 100644 index 0000000..ac36243 --- /dev/null +++ b/Documentation/Maintenance.rst @@ -0,0 +1,14 @@ +Maintenance +=========== + +List of changes that need to be done for maintenance reasons. +Those affect the extension itself, not users of the extension. + +E.g. changes once we drop a certain TYPO3 version. +We might have new code backported for compatibility in older TYPO3 versions. +Those changes are documented so we know what to do once we drop an older version. + +.. toctree:: + :glob: + + Maintenance/* diff --git a/Documentation/Maintenance/v11.rst b/Documentation/Maintenance/v11.rst new file mode 100644 index 0000000..71e7885 --- /dev/null +++ b/Documentation/Maintenance/v11.rst @@ -0,0 +1,8 @@ +V11 +=== + +Remove TCA fallback wrapped in version constraint in: + +- ``Configuration/TCA/tx_tracking_pageview.php`` + +- ``Configuration/TCA/tx_tracking_recordview.php``