Skip to content

Commit 08ba31a

Browse files
committed
Merge branch 'typo3-v14'
# Conflicts: # .github/workflows/ci.yml # Classes/Form/Element/RedirectElement.php # Classes/Service/RedirectDemandService.php # Resources/Private/Templates/Backend/List.html # composer.json # ext_emconf.php
2 parents f025175 + aad40e4 commit 08ba31a

12 files changed

Lines changed: 146 additions & 168 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
branches:
88
- main
99
- 4.0
10-
- 42/constructor
1110
pull_request:
1211
permissions:
1312
contents: read
@@ -70,7 +69,6 @@ jobs:
7069
- "php:csfix"
7170
- "php:sniff"
7271
- "ts:lint"
73-
- "xliff:lint"
7472
php-version:
7573
- "8.2"
7674
- "8.3"
@@ -116,16 +114,16 @@ jobs:
116114
fail-fast: false
117115
matrix:
118116
include:
119-
- typo3-version: "^13.4"
117+
- typo3-version: "^14.0"
120118
php-version: "8.2"
121119
composer-dependencies: highest
122-
- typo3-version: "^13.4"
120+
- typo3-version: "^14.0"
123121
php-version: "8.3"
124122
composer-dependencies: highest
125-
- typo3-version: "^13.4"
123+
- typo3-version: "^14.0"
126124
php-version: "8.4"
127125
composer-dependencies: highest
128-
- typo3-version: "^13.4"
126+
- typo3-version: "^14.0"
129127
php-version: "8.5"
130128
composer-dependencies: highest
131129
functional-tests:
@@ -144,25 +142,25 @@ jobs:
144142
uses: actions/checkout@v4
145143

146144
- name: Install testing system
147-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }}
145+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }}
148146

149147
- name: Functional Tests with mariadb (min)
150-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -i 10.4 -s functional
148+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -i 10.4 -s functional
151149

152150
- name: Functional Tests with mariadb (max)
153-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -i 10.11 -s functional
151+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -i 10.11 -s functional
154152

155153
- name: Functional Tests with mysql (min)
156-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional
154+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional
157155

158156
- name: Functional Tests with mysql (max)
159-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.4 -s functional
157+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -i 8.4 -s functional
160158

161159
- name: Functional Tests with postgres (min)
162-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -i 10 -s functional
160+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -i 10 -s functional
163161

164162
- name: Functional Tests with postgres (max)
165-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -i 18 -s functional
163+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -i 18 -s functional
166164

167165
- name: Functional Tests with sqlite
168-
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d sqlite -s functional
166+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d sqlite -s functional

Build/Scripts/runTests.sh

Lines changed: 38 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ handleDbmsOptions() {
4545
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
4646
exit 1
4747
fi
48-
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.2"
49-
if ! [[ ${DBMS_VERSION} =~ ^(10.2|10.3|10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1|11.4|11.8)$ ]]; then
48+
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.11"
49+
if ! [[ ${DBMS_VERSION} =~ ^(10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1|11.4|11.8)$ ]]; then
5050
echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2
5151
echo >&2
5252
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
@@ -61,8 +61,8 @@ handleDbmsOptions() {
6161
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
6262
exit 1
6363
fi
64-
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="5.5"
65-
if ! [[ ${DBMS_VERSION} =~ ^(5.5|5.6|5.7|8.0|8.4)$ ]]; then
64+
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="8.4"
65+
if ! [[ ${DBMS_VERSION} =~ ^(8.0|8.1|8.2|8.3|8.4|9.5)$ ]]; then
6666
echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2
6767
echo >&2
6868
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
@@ -76,7 +76,7 @@ handleDbmsOptions() {
7676
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
7777
exit 1
7878
fi
79-
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10"
79+
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="16"
8080
if ! [[ ${DBMS_VERSION} =~ ^(10|11|12|13|14|15|16|17|18)$ ]]; then
8181
echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2
8282
echo >&2
@@ -151,7 +151,7 @@ restoreComposerFiles() {
151151

152152
loadHelp() {
153153
# Load help text into $HELP
154-
read -r -d '' HELP <<EOF
154+
read -r -d '' HELP <<'EOF'
155155
TYPO3 core test runner. Execute unit, functional and other test suites in
156156
a container based test environment. Handles execution of single test files,
157157
sending xdebug information to a local IDE and more.
@@ -200,28 +200,23 @@ Options:
200200
-i version
201201
Specify a specific database version
202202
With "-d mariadb":
203-
- 10.2 short-term, maintained until 2023-05-25 (default)
204-
- 10.3 short-term, maintained until 2023-05-25
205203
- 10.4 short-term, maintained until 2024-06-18
206204
- 10.5 short-term, maintained until 2025-06-24
207205
- 10.6 long-term, maintained until 2026-06
208206
- 10.7 short-term, no longer maintained
209207
- 10.8 short-term, maintained until 2023-05
210208
- 10.9 short-term, maintained until 2023-08
211209
- 10.10 short-term, maintained until 2023-11
212-
- 10.11 long-term, maintained until 2028-02
210+
- 10.11 long-term, maintained until 2028-02 (default)
213211
- 11.0 development series
214212
- 11.1 short-term development series
215213
- 11.4 long-term, maintained until 2033-01
216214
- 11.8 long-term, maintained until 2033-10
217215
With "-d mysql":
218-
- 5.5 unmaintained since 2018-12 (default)
219-
- 5.6 unmaintained since 2021-02
220-
- 5.7 maintained until 2023-10
221-
- 8.0 maintained until 2026-04
222-
- 8.4 long-term, maintained until 2032-30
216+
- 8.0 long-term, maintained until 2026-04
217+
- 8.4 long-term, maintained until 2032-30
223218
With "-d postgres":
224-
- 10 unmaintained since 2022-11-10 (default)
219+
- 10 unmaintained since 2022-11-10
225220
- 11 unmaintained since 2023-11-09
226221
- 12 maintained until 2024-11-14
227222
- 13 maintained until 2025-11-13
@@ -231,22 +226,18 @@ Options:
231226
- 17 maintained until 2029-11-08
232227
- 18 maintained until 2029-11-14
233228
234-
-t <11|12|13>
229+
-t <13>
235230
Only with -s composerInstall|composerInstallMin|composerInstallMax
236231
Specifies the TYPO3 CORE Version to be used
237-
- 11.5: use TYPO3 v11 (default)
238-
- 12.4: use TYPO3 v12
239-
- 13.4: use TYPO3 v13
232+
- 13.4: use TYPO3 v13 (default)
233+
- 14.0: use TYPO3 v14
240234
241-
-p <7.4|8.0|8.1|8.2|8.3|8.4|8.5>
235+
-p <8.2|8.3|8.4|8.5>
242236
Specifies the PHP minor version to be used
243-
- 7.4: use PHP 7.4 (default)
244-
- 8.0: use PHP 8.0
245-
- 8.1: use PHP 8.1
246237
- 8.2: use PHP 8.2
247-
- 8.3: use PHP 8.3
238+
- 8.3: use PHP 8.3 (default)
248239
- 8.4: use PHP 8.4
249-
- 8.5: use PHP 8.5
240+
- 8.5: use PHP 8.5
250241
251242
-e "<phpunit options>"
252243
Only with -s docsGenerate|functional|unit
@@ -283,24 +274,24 @@ Options:
283274
Show this help.
284275
285276
Examples:
286-
# Run all core unit tests using PHP 7.4
277+
# Run all core unit tests using PHP 8.5
287278
./Build/Scripts/runTests.sh -s unit
288279
289280
# Run all core units tests and enable xdebug (have a PhpStorm listening on port 9003!)
290281
./Build/Scripts/runTests.sh -x -s unit
291282
292-
# Run unit tests in phpunit verbose mode with xdebug on PHP 8.1 and filter for test canRetrieveValueWithGP
293-
./Build/Scripts/runTests.sh -x -p 8.1 -- --filter 'classCanBeRegistered'
283+
# Run unit tests in phpunit verbose mode with xdebug on PHP 8.3 and filter for test canRetrieveValueWithGP
284+
./Build/Scripts/runTests.sh -x -p 8.3 -- --filter 'classCanBeRegistered'
294285
295286
# Run functional tests in phpunit with a filtered test method name in a specified file
296287
# example will currently execute two tests, both of which start with the search term
297288
./Build/Scripts/runTests.sh -s functional -- --filter 'findRecordByImportSource' Tests/Functional/Repository/CategoryRepositoryTest.php
298289
299-
# Run functional tests on postgres with xdebug, php 8.1 and execute a restricted set of tests
300-
./Build/Scripts/runTests.sh -x -p 8.1 -s functional -d postgres -- Tests/Functional/Repository/CategoryRepositoryTest.php
290+
# Run functional tests on postgres with xdebug, php 8.3 and execute a restricted set of tests
291+
./Build/Scripts/runTests.sh -x -p 8.3 -s functional -d postgres -- Tests/Functional/Repository/CategoryRepositoryTest.php
301292
302-
# Run functional tests on postgres 11
303-
./Build/Scripts/runTests.sh -s functional -d postgres -i 11
293+
# Run functional tests on postgres 16
294+
./Build/Scripts/runTests.sh -s functional -d postgres -i 16
304295
EOF
305296
}
306297

@@ -319,17 +310,17 @@ ROOT_DIR="${PWD}"
319310

320311
# Option defaults
321312
TEST_SUITE=""
322-
TYPO3_VERSION="11"
313+
TYPO3_VERSION="14"
323314
DBMS="sqlite"
324315
DBMS_VERSION=""
325-
PHP_VERSION="8.1"
316+
PHP_VERSION="8.3"
326317
PHP_XDEBUG_ON=0
327318
PHP_XDEBUG_PORT=9003
328319
EXTRA_TEST_OPTIONS=""
329320
CGLCHECK_DRY_RUN=0
330321
DATABASE_DRIVER=""
331322
CONTAINER_BIN=""
332-
COMPOSER_ROOT_VERSION="12.4.2"
323+
COMPOSER_ROOT_VERSION="14.0.1"
333324
CONTAINER_INTERACTIVE="-it --init"
334325
HOST_UID=$(id -u)
335326
HOST_PID=$(id -g)
@@ -369,7 +360,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do
369360
;;
370361
p)
371362
PHP_VERSION=${OPTARG}
372-
if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3|8.4|8.5)$ ]]; then
363+
if ! [[ ${PHP_VERSION} =~ ^(8.2|8.3|8.4|8.5)$ ]]; then
373364
INVALID_OPTIONS+=("-p ${OPTARG}")
374365
fi
375366
;;
@@ -378,7 +369,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do
378369
;;
379370
t)
380371
TYPO3_VERSION=${OPTARG}
381-
if ! [[ ${TYPO3_VERSION} =~ ^(11|12|13)$ ]]; then
372+
if ! [[ ${TYPO3_VERSION} =~ ^(14)$ ]]; then
382373
INVALID_OPTIONS+=("-t ${OPTARG}")
383374
fi
384375
;;
@@ -451,7 +442,7 @@ mkdir -p .cache
451442
mkdir -p .Build/public/typo3temp/var/tests
452443

453444
IMAGE_PHP="ghcr.io/typo3/core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest"
454-
IMAGE_ALPINE="docker.io/alpine:3.8"
445+
IMAGE_ALPINE="docker.io/alpine:3.22"
455446
IMAGE_DOCS="ghcr.io/typo3-documentation/render-guides:latest"
456447
IMAGE_MARIADB="docker.io/mariadb:${DBMS_VERSION}"
457448
IMAGE_MYSQL="docker.io/mysql:${DBMS_VERSION}"
@@ -516,17 +507,9 @@ case ${TEST_SUITE} in
516507
cleanComposer
517508
stashComposerFiles
518509
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-highest-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c "
519-
if [ ${TYPO3_VERSION} -eq 11 ]; then
510+
if [ ${TYPO3_VERSION} -eq 14 ]; then
520511
composer require --no-ansi --no-interaction --no-progress --no-install \
521-
typo3/cms-core:^11.5.24 || exit 1
522-
fi
523-
if [ ${TYPO3_VERSION} -eq 12 ]; then
524-
composer require --no-ansi --no-interaction --no-progress --no-install \
525-
typo3/cms-core:^12.4.2 || exit 1
526-
fi
527-
if [ ${TYPO3_VERSION} -eq 13 ]; then
528-
composer require --no-ansi --no-interaction --no-progress --no-install \
529-
typo3/cms-core:^13.4 || exit 1
512+
typo3/cms-core:^14.0 || exit 1
530513
fi
531514
composer update --no-progress --no-interaction || exit 1
532515
composer show || exit 1
@@ -538,17 +521,9 @@ case ${TEST_SUITE} in
538521
cleanComposer
539522
stashComposerFiles
540523
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-lowest-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c "
541-
if [ ${TYPO3_VERSION} -eq 11 ]; then
542-
composer require --no-ansi --no-interaction --no-progress --no-install \
543-
typo3/cms-core:^11.5.24 || exit 1
544-
fi
545-
if [ ${TYPO3_VERSION} -eq 12 ]; then
546-
composer require --no-ansi --no-interaction --no-progress --no-install \
547-
typo3/cms-core:^12.4.2 || exit 1
548-
fi
549-
if [ ${TYPO3_VERSION} -eq 13 ]; then
524+
if [ ${TYPO3_VERSION} -eq 14 ]; then
550525
composer require --no-ansi --no-interaction --no-progress --no-install \
551-
typo3/cms-core:^13.4 || exit 1
526+
typo3/cms-core:^14.0 || exit 1
552527
fi
553528
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest || exit 1
554529
composer show || exit 1
@@ -588,7 +563,11 @@ case ${TEST_SUITE} in
588563
SUITE_EXIT_CODE=$?
589564
;;
590565
postgres)
591-
${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-func-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs /var/lib/postgresql/data:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null
566+
POSTGRES_TMPFS="/var/lib/postgresql/data"
567+
if [[ ${DBMS_VERSION} -eq 18 ]]; then
568+
POSTGRES_TMPFS="/var/lib/postgresql"
569+
fi
570+
${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-func-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs ${POSTGRES_TMPFS}:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null
592571
waitFor postgres-func-${SUFFIX} 5432
593572
CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=bamboo -e typo3DatabaseUsername=funcu -e typo3DatabaseHost=postgres-func-${SUFFIX} -e typo3DatabasePassword=funcp"
594573
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}"

Build/phpunit/FunctionalTestsBootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the TYPO3 CMS project.
45
*

Build/phpunit/UnitTestsBootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the TYPO3 CMS project.
45
*

Classes/Form/Element/RedirectElement.php

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66

77
use Ayacoo\RedirectTab\Service\RedirectDemandService;
88
use Ayacoo\RedirectTab\UserFunctions\RedirectAccessDisplayCondition;
9+
use Psr\Http\Message\ServerRequestInterface;
910
use Psr\Http\Message\UriInterface;
1011
use TYPO3\CMS\Backend\Form\Element\AbstractFormElement;
12+
use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
1113
use TYPO3\CMS\Backend\Routing\UriBuilder;
1214
use TYPO3\CMS\Core\Http\Uri;
1315
use TYPO3\CMS\Core\Utility\GeneralUtility;
14-
use TYPO3\CMS\Fluid\View\StandaloneView;
16+
use TYPO3\CMS\Core\View\ViewFactoryData;
17+
use TYPO3\CMS\Core\View\ViewFactoryInterface;
18+
use TYPO3\CMS\Core\View\ViewInterface;
1519
use TYPO3\CMS\Redirects\Utility\RedirectConflict;
1620

1721
class RedirectElement extends AbstractFormElement
1822
{
19-
private StandaloneView $view;
23+
private ViewInterface $view;
2024

2125
public function render(): array
2226
{
@@ -29,7 +33,7 @@ public function render(): array
2933
$currentPage = 1;
3034
}
3135

32-
$this->prepareView();
36+
$this->prepareView($request);
3337

3438
$redirectAccess = GeneralUtility::makeInstance(RedirectAccessDisplayCondition::class);
3539
$this->view->assignMultiple([
@@ -43,21 +47,23 @@ public function render(): array
4347
]);
4448

4549
$result = $this->initializeResultArray();
46-
$result['html'] = $this->view->render();
50+
$result['html'] = $this->view->render('List');
4751
return $result;
4852
}
4953

50-
protected function prepareView(): void
54+
protected function prepareView(ServerRequestInterface $request): void
5155
{
52-
$templateName = 'List';
53-
$this->view = GeneralUtility::makeInstance(StandaloneView::class);
54-
$this->view->setTemplate($templateName);
55-
$this->view->setTemplateRootPaths(['EXT:redirect_tab/Resources/Private/Templates/Backend']);
56-
$this->view->setPartialRootPaths(['EXT:redirect_tab/Resources/Private/Partials/Backend']);
57-
$this->view->setLayoutRootPaths(['EXT:redirect_tab/Resources/Private/Layouts']);
56+
$viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class);
57+
$viewFactoryData = new ViewFactoryData(
58+
templateRootPaths: ['EXT:redirect_tab/Resources/Private/Templates/Backend'],
59+
partialRootPaths: ['EXT:redirect_tab/Resources/Private/Partials/Backend'],
60+
layoutRootPaths: ['EXT:redirect_tab/Resources/Private/Layouts'],
61+
request: $request,
62+
);
63+
$this->view = $viewFactory->create($viewFactoryData);
5864
}
5965

60-
protected function buildRedirectUrl(int $currentPage): UriInterface|Uri
66+
protected function buildRedirectUrl(int $currentPage): UriInterface|Uri|null
6167
{
6268
$backendUriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
6369
$uriParameters = [
@@ -69,6 +75,10 @@ protected function buildRedirectUrl(int $currentPage): UriInterface|Uri
6975
'page' => $currentPage,
7076
];
7177

72-
return $backendUriBuilder->buildUriFromRoute('record_edit', $uriParameters);
78+
try {
79+
return $backendUriBuilder->buildUriFromRoute('record_edit', $uriParameters);
80+
} catch (RouteNotFoundException) {
81+
return null;
82+
}
7383
}
7484
}

0 commit comments

Comments
 (0)