Remove v12 upgrade findings

Ignore false positives for extension scanner.
Migrate TCA and keep old v11 within condition for backwards
compatibility.

Relates: #110
This commit is contained in:
Daniel Siepmann 2023-05-11 08:15:25 +02:00
parent 38a2be296a
commit 19b7fff24f
8 changed files with 59 additions and 15 deletions

View file

@ -107,6 +107,7 @@ class Pageview
'crdate' => $pageview->getCrdate()->format('U'), 'crdate' => $pageview->getCrdate()->format('U'),
'tstamp' => $pageview->getCrdate()->format('U'), 'tstamp' => $pageview->getCrdate()->format('U'),
'type' => $pageview->getPageType(), 'type' => $pageview->getPageType(),
// @extensionScannerIgnoreLine
'sys_language_uid' => $pageview->getLanguage()->getLanguageId(), 'sys_language_uid' => $pageview->getLanguage()->getLanguageId(),
'url' => $pageview->getUrl(), 'url' => $pageview->getUrl(),
'user_agent' => $pageview->getUserAgent(), 'user_agent' => $pageview->getUserAgent(),

View file

@ -53,6 +53,7 @@ class Recordview
'pid' => $recordview->getPageUid(), 'pid' => $recordview->getPageUid(),
'crdate' => $recordview->getCrdate()->format('U'), 'crdate' => $recordview->getCrdate()->format('U'),
'tstamp' => $recordview->getCrdate()->format('U'), 'tstamp' => $recordview->getCrdate()->format('U'),
// @extensionScannerIgnoreLine
'sys_language_uid' => $recordview->getLanguage()->getLanguageId(), 'sys_language_uid' => $recordview->getLanguage()->getLanguageId(),
'url' => $recordview->getUrl(), 'url' => $recordview->getUrl(),
'user_agent' => $recordview->getUserAgent(), 'user_agent' => $recordview->getUserAgent(),

View file

@ -1,6 +1,6 @@
<?php <?php
return [ $tca = [
'ctrl' => [ 'ctrl' => [
'label' => 'url', 'label' => 'url',
'label_alt' => 'crdate', 'label_alt' => 'crdate',
@ -8,7 +8,6 @@ return [
'default_sortby' => 'crdate DESC', 'default_sortby' => 'crdate DESC',
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'languageField' => 'sys_language_uid', 'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent', 'transOrigPointerField' => 'l10n_parent',
'title' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview', 'title' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview',
@ -32,9 +31,7 @@ return [
'crdate' => [ 'crdate' => [
'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview.crdate', 'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview.crdate',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'datetime',
'eval' => 'datetime',
'renderType' => 'inputDateTime',
], ],
], ],
'sys_language_uid' => [ 'sys_language_uid' => [
@ -58,9 +55,8 @@ return [
'type' => [ 'type' => [
'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview.type', 'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.pageview.type',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'number',
'readOnly' => true, 'readOnly' => true,
'eval' => 'int',
], ],
], ],
'url' => [ 'url' => [
@ -73,3 +69,16 @@ return [
], ],
], ],
]; ];
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;

View file

@ -1,6 +1,6 @@
<?php <?php
return [ $tca = [
'ctrl' => [ 'ctrl' => [
'label' => 'record', 'label' => 'record',
'label_alt' => 'crdate', 'label_alt' => 'crdate',
@ -8,7 +8,6 @@ return [
'default_sortby' => 'crdate DESC', 'default_sortby' => 'crdate DESC',
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'languageField' => 'sys_language_uid', 'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent', 'transOrigPointerField' => 'l10n_parent',
'title' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.recordview', 'title' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.recordview',
@ -32,9 +31,7 @@ return [
'crdate' => [ 'crdate' => [
'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.recordview.crdate', 'label' => 'LLL:EXT:tracking/Resources/Private/Language/locallang_tca.xlf:table.recordview.crdate',
'config' => [ 'config' => [
'type' => 'input', 'type' => 'inputDateTime',
'eval' => 'datetime',
'renderType' => 'inputDateTime',
], ],
], ],
'sys_language_uid' => [ 'sys_language_uid' => [
@ -75,3 +72,13 @@ return [
], ],
], ],
]; ];
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;

View file

@ -1,4 +1,4 @@
2.6.0 2.5.1
===== =====
Breaking Breaking
@ -9,8 +9,6 @@ Nothing
Features Features
-------- --------
Nothing
Fixes Fixes
----- -----
@ -27,6 +25,11 @@ Tasks
* Migrate test fixtures to PHP Data Sets using `codappix/typo3-php-datasets <https://packagist.org/packages/codappix/typo3-php-datasets>`_ * Migrate test fixtures to PHP Data Sets using `codappix/typo3-php-datasets <https://packagist.org/packages/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 Deprecation
----------- -----------

View file

@ -90,4 +90,5 @@ in order to extract further information from them with future updates.
Installation Installation
Pageview Pageview
Recordview Recordview
Maintenance
Changelog Changelog

View file

@ -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/*

View file

@ -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``