Skip to content

Commit 65e992c

Browse files
committed
[FEATURE][WIP] Full support for TYPO3 14 (pending: editing of Scheduler tasks)
1 parent 1d23663 commit 65e992c

68 files changed

Lines changed: 947 additions & 605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/composer.lock
44
/composer.json.testing
55
/.ddev/
6+
/var/
7+
/packages/

Build/Scripts/runTests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ Options:
202202
- 15 maintained until 2027-11-11
203203
- 16 maintained until 2028-11-09
204204
205-
-p <8.1|8.2|8.3|8.4>
205+
-p <8.2|8.3|8.4|8.5>
206206
Specifies the PHP minor version to be used
207-
- 8.1: (default) use PHP 8.1
208-
- 8.2: use PHP 8.2
207+
- 8.2: (default) use PHP 8.2
209208
- 8.3: use PHP 8.3
210209
- 8.4: use PHP 8.4
210+
- 8.5: use PHP 8.5
211211
212212
-x
213213
Only with -s functional|unit
@@ -255,7 +255,7 @@ TEST_SUITE="cgl"
255255
DATABASE_DRIVER=""
256256
DBMS="mysql"
257257
DBMS_VERSION=""
258-
PHP_VERSION="8.1"
258+
PHP_VERSION="8.2"
259259
PHP_XDEBUG_ON=0
260260
PHP_XDEBUG_PORT=9003
261261
CGLCHECK_DRY_RUN=0
@@ -292,7 +292,7 @@ while getopts "a:b:d:i:s:p:xy:nhu" OPT; do
292292
;;
293293
p)
294294
PHP_VERSION=${OPTARG}
295-
if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3|8.4)$ ]]; then
295+
if ! [[ ${PHP_VERSION} =~ ^(8.2|8.3|8.4|8.5)$ ]]; then
296296
INVALID_OPTIONS+=("p ${OPTARG}")
297297
fi
298298
;;

Build/rector/rector.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
->withSets([
3535
Typo3SetList::CODE_QUALITY,
3636
Typo3SetList::GENERAL,
37-
Typo3LevelSetList::UP_TO_TYPO3_12,
37+
Typo3LevelSetList::UP_TO_TYPO3_13,
3838
])
3939
->withImportNames(importShortClasses: false, removeUnusedImports: true)
4040
// To have a better analysis from PHPStan, we teach it here some more things
@@ -46,13 +46,9 @@
4646
ConvertImplicitVariablesToExplicitGlobalsRector::class,
4747
])
4848
->withConfiguredRule(ExtEmConfRector::class, [
49-
ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '12.4.0-13.4.99',
49+
ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '13.4.0-14.3.99',
5050
ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [],
5151
])
5252
// If you use importNames(), you should consider excluding some TYPO3 files.
53-
->withSkip([
54-
// AddLiteralSeparatorToNumberRector would make the exception codes more readable.
55-
// But as they are just timestamps this is not needed/wanted.
56-
AddLiteralSeparatorToNumberRector::class,
57-
])
53+
->withSkip([])
5854
;

Classes/Command/ImportCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* The TYPO3 project - inspiring people to share!
1818
*/
1919

20-
use Cobweb\ExternalImport\Context\AbstractCallContext;
2120
use Cobweb\ExternalImport\Context\CommandLineCallContext;
2221
use Cobweb\ExternalImport\Domain\Repository\ConfigurationRepository;
2322
use Cobweb\ExternalImport\Enum\CallType;
@@ -138,7 +137,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
138137
} else {
139138
$this->importer = GeneralUtility::makeInstance(Importer::class);
140139
$this->importer->setCallType(CallType::CommandLine);
141-
/** @var AbstractCallContext $callContext */
142140
$callContext = GeneralUtility::makeInstance(
143141
CommandLineCallContext::class,
144142
$this->importer

Classes/Controller/DataModuleController.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
use TYPO3\CMS\Backend\Utility\BackendUtility;
2929
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
3030
use TYPO3\CMS\Core\Http\PropagateResponseException;
31-
use TYPO3\CMS\Core\Imaging\Icon;
3231
use TYPO3\CMS\Core\Imaging\IconFactory;
32+
use TYPO3\CMS\Core\Imaging\IconSize;
3333
use TYPO3\CMS\Core\Localization\LanguageService;
3434
use TYPO3\CMS\Core\Page\PageRenderer;
3535
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
@@ -74,8 +74,8 @@ public function initializeAction(): void
7474
{
7575
$this->moduleTemplate = $this->moduleTemplateFactory->create($this->request);
7676
$this->moduleTemplate->setTitle(
77-
'External Import - ' .
78-
$this->getLanguageService()->sL('LLL:EXT:external_import/Resources/Private/Language/DataModule.xlf:mlang_tabs_tab')
77+
'External Import - '
78+
. $this->getLanguageService()->sL('LLL:EXT:external_import/Resources/Private/Language/DataModule.xlf:mlang_tabs_tab')
7979
);
8080
}
8181

@@ -257,7 +257,6 @@ public function previewAction(string $table, string $index, string $stepClass =
257257
* @param string $stepClass
258258
* @return ResponseInterface
259259
* @throws PropagateResponseException
260-
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
261260
*/
262261
public function downloadPreviewAction(string $table, string $index, string $stepClass): ResponseInterface
263262
{
@@ -629,7 +628,7 @@ protected function prepareMainMenu(string $action): void
629628
*/
630629
protected function prepareCloseButton(string $returnAction): void
631630
{
632-
$closeIcon = $this->iconFactory->getIcon('actions-close', Icon::SIZE_SMALL);
631+
$closeIcon = $this->iconFactory->getIcon('actions-close', IconSize::SMALL);
633632
$closeButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeLinkButton()
634633
->setIcon($closeIcon)
635634
->setTitle(LocalizationUtility::translate('back_to_list', 'external_import'))

Classes/Controller/LogAjaxController.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ class LogAjaxController
3232
/**
3333
* Returns the list of all log entries, in JSON format.
3434
*
35-
* @param ServerRequestInterface $request
36-
* @param ResponseInterface|null $response
37-
* @return ResponseInterface
3835
* @throws \JsonException
3936
*/
4037
public function getAction(ServerRequestInterface $request): ResponseInterface

Classes/Controller/LogModuleController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function initializeAction(): void
5454
{
5555
$this->moduleTemplate = $this->moduleTemplateFactory->create($this->request);
5656
$this->moduleTemplate->setTitle(
57-
'External Import - ' .
58-
$this->getLanguageService()->sL('LLL:EXT:external_import/Resources/Private/Language/LogModule.xlf:mlang_tabs_tab')
57+
'External Import - '
58+
. $this->getLanguageService()->sL('LLL:EXT:external_import/Resources/Private/Language/LogModule.xlf:mlang_tabs_tab')
5959
);
6060
}
6161

Classes/Domain/Model/Configuration.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public function processConfiguration(): void
122122
}
123123
$tcaRepository = GeneralUtility::makeInstance(TcaRepositoryInterface::class);
124124
// Check for nullable property
125-
$columnTca = $tcaRepository->getTca()[$this->table]['columns'][$columnName]['config'] ?? [];
126-
if ($this->isNullable($columnTca)) {
125+
$columnTca = $tcaRepository->getTca()[$this->table]['columns'][$columnName]['config'] ?? null;
126+
if (is_array($columnTca) && $this->isNullable($columnTca)) {
127127
$this->processedConfiguration->addNullableColumn($columnName);
128128
}
129129
// Process children configurations
@@ -206,12 +206,6 @@ public function setGeneralConfiguration(array $generalConfiguration, ?array $def
206206
{
207207
$this->rawGeneralConfiguration = $generalConfiguration;
208208
$this->generalConfiguration = $generalConfiguration;
209-
// TODO: drop support for old "group" property in the next major version; for now automatically convert it
210-
if (array_key_exists('group', $generalConfiguration)) {
211-
$this->generalConfiguration['groups'] = [
212-
$generalConfiguration['group'],
213-
];
214-
}
215209
$stepUtility = GeneralUtility::makeInstance(StepUtility::class);
216210
// Define the process default steps, depending on process type or the predefined value
217211
// NOTE: normally default steps should always be defined
@@ -563,8 +557,8 @@ public function isNullable(array $columnTca): bool
563557

564558
// A relation-type column with minitems missing or equals 0 is also considered nullable
565559
} elseif (
566-
in_array($columnTca['type'] ?? '', ['select', 'group', 'inline', 'file'], true) &&
567-
(!array_key_exists('minitems', $columnTca) || $columnTca['minitems'] === 0)
560+
in_array($columnTca['type'] ?? '', ['select', 'group', 'inline', 'file'], true)
561+
&& (!array_key_exists('minitems', $columnTca) || $columnTca['minitems'] === 0)
568562
) {
569563
$nullable = true;
570564
}

Classes/Domain/Repository/ConfigurationRepository.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,16 @@ public function findByGroup(string $group, bool $synchronizable = false, bool $n
173173
}
174174
// Skip the configurations we don't want, if either flag has been set
175175
if (
176-
($synchronizable && empty($externalConfiguration['connector'])) ||
177-
($nonSynchronizable && !empty($externalConfiguration['connector']))
176+
($synchronizable && empty($externalConfiguration['connector']))
177+
|| ($nonSynchronizable && !empty($externalConfiguration['connector']))
178178
) {
179179
continue;
180180
}
181181
// TODO: drop support for "group" property in the next major version
182182
$configuredGroups = $externalConfiguration['groups'] ?? [];
183183
if (
184-
(array_key_exists('group', $externalConfiguration) && $externalConfiguration['group'] === $group) ||
185-
(is_array($configuredGroups) && in_array($group, $configuredGroups, true))
184+
(array_key_exists('group', $externalConfiguration) && $externalConfiguration['group'] === $group)
185+
|| (is_array($configuredGroups) && in_array($group, $configuredGroups, true))
186186
) {
187187
// Default priority if not defined, set to very low
188188
$priority = $externalConfiguration['priority'] ?? Importer::DEFAULT_PRIORITY;
@@ -221,8 +221,8 @@ public function findAllGroups(bool $synchronizable = false, bool $nonSynchroniza
221221
}
222222
// Skip the configurations we don't want, if either flag has been set
223223
if (
224-
($synchronizable && empty($externalConfiguration['connector'])) ||
225-
($nonSynchronizable && !empty($externalConfiguration['connector']))
224+
($synchronizable && empty($externalConfiguration['connector']))
225+
|| ($nonSynchronizable && !empty($externalConfiguration['connector']))
226226
) {
227227
continue;
228228
}
@@ -287,7 +287,6 @@ public function findBySync(bool $isSynchronizable): array
287287
$configurations = [];
288288

289289
// Get a list of all external import Scheduler tasks
290-
$tasks = [];
291290
$schedulerRepository = GeneralUtility::makeInstance(SchedulerRepository::class);
292291
$tasks = $schedulerRepository->fetchAllTasks();
293292

@@ -306,8 +305,8 @@ public function findBySync(bool $isSynchronizable): array
306305
// Synchronizable tables have a connector configuration
307306
// Non-synchronizable tables don't
308307
if (
309-
($isSynchronizable && !empty($externalConfiguration['connector'])) ||
310-
(!$isSynchronizable && empty($externalConfiguration['connector']))
308+
($isSynchronizable && !empty($externalConfiguration['connector']))
309+
|| (!$isSynchronizable && empty($externalConfiguration['connector']))
311310
) {
312311
// If priority is not defined, set to very low
313312
// NOTE: the priority doesn't matter for non-synchronizable tables

0 commit comments

Comments
 (0)