From 0b93e79a5378551584dd7425d2307de5654ef02d Mon Sep 17 00:00:00 2001 From: Guido Schmechel Date: Sat, 20 Dec 2025 23:23:11 +0100 Subject: [PATCH 1/6] Init v14 version --- .github/workflows/ci.yml | 27 +++--- Build/Scripts/runTests.sh | 89 +++++++------------ Classes/Form/Element/RedirectElement.php | 36 +++++--- Classes/Service/RedirectDemandService.php | 59 +++++------- .../ViewHelpers/RouteParametersViewHelper.php | 4 +- README.md | 13 +-- composer.json | 25 +++--- ext_emconf.php | 8 +- 8 files changed, 116 insertions(+), 145 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 459757b..b633689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: push: branches: - main - - 4.0 + - typo3-v14 pull_request: permissions: contents: read @@ -69,7 +69,6 @@ jobs: - "php:csfix" - "php:sniff" - "ts:lint" - - "xliff:lint" php-version: - "8.2" - "8.3" @@ -115,16 +114,16 @@ jobs: fail-fast: false matrix: include: - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.2" composer-dependencies: highest - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.3" composer-dependencies: highest - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.4" composer-dependencies: highest - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.5" composer-dependencies: highest functional-tests: @@ -143,25 +142,25 @@ jobs: uses: actions/checkout@v4 - name: Install testing system - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }} + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }} - name: Functional Tests with mariadb (min) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -i 10.4 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -i 10.4 -s functional - name: Functional Tests with mariadb (max) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -i 10.11 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -i 10.11 -s functional - name: Functional Tests with mysql (min) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional - name: Functional Tests with mysql (max) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.4 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -i 8.4 -s functional - name: Functional Tests with postgres (min) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -i 10 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -i 10 -s functional - name: Functional Tests with postgres (max) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -i 18 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -i 18 -s functional - name: Functional Tests with sqlite - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d sqlite -s functional \ No newline at end of file + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d sqlite -s functional \ No newline at end of file diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 1a31e08..bbdb195 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -45,8 +45,8 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.2" - 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 + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.11" + 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 echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 @@ -61,8 +61,8 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="5.5" - if ! [[ ${DBMS_VERSION} =~ ^(5.5|5.6|5.7|8.0|8.4)$ ]]; then + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="8.4" + if ! [[ ${DBMS_VERSION} =~ ^(8.0|8.1|8.2|8.3|8.4|9.5)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 @@ -76,7 +76,7 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10" + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="16" if ! [[ ${DBMS_VERSION} =~ ^(10|11|12|13|14|15|16|17|18)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 @@ -200,8 +200,6 @@ Options: -i version Specify a specific database version With "-d mariadb": - - 10.2 short-term, maintained until 2023-05-25 (default) - - 10.3 short-term, maintained until 2023-05-25 - 10.4 short-term, maintained until 2024-06-18 - 10.5 short-term, maintained until 2025-06-24 - 10.6 long-term, maintained until 2026-06 @@ -209,19 +207,16 @@ Options: - 10.8 short-term, maintained until 2023-05 - 10.9 short-term, maintained until 2023-08 - 10.10 short-term, maintained until 2023-11 - - 10.11 long-term, maintained until 2028-02 + - 10.11 long-term, maintained until 2028-02 (default) - 11.0 development series - 11.1 short-term development series - 11.4 long-term, maintained until 2033-01 - 11.8 long-term, maintained until 2033-10 With "-d mysql": - - 5.5 unmaintained since 2018-12 (default) - - 5.6 unmaintained since 2021-02 - - 5.7 maintained until 2023-10 - - 8.0 maintained until 2026-04 - - 8.4 long-term, maintained until 2032-30 + - 8.0 long-term, maintained until 2026-04 + - 8.4 long-term, maintained until 2032-30 With "-d postgres": - - 10 unmaintained since 2022-11-10 (default) + - 10 unmaintained since 2022-11-10 - 11 unmaintained since 2023-11-09 - 12 maintained until 2024-11-14 - 13 maintained until 2025-11-13 @@ -231,22 +226,18 @@ Options: - 17 maintained until 2029-11-08 - 18 maintained until 2029-11-14 - -t <11|12|13> + -t <13> Only with -s composerInstall|composerInstallMin|composerInstallMax Specifies the TYPO3 CORE Version to be used - - 11.5: use TYPO3 v11 (default) - - 12.4: use TYPO3 v12 - - 13.4: use TYPO3 v13 + - 13.4: use TYPO3 v13 (default) + - 14.0: use TYPO3 v14 - -p <7.4|8.0|8.1|8.2|8.3|8.4|8.5> + -p <8.2|8.3|8.4|8.5> Specifies the PHP minor version to be used - - 7.4: use PHP 7.4 (default) - - 8.0: use PHP 8.0 - - 8.1: use PHP 8.1 - 8.2: use PHP 8.2 - - 8.3: use PHP 8.3 + - 8.3: use PHP 8.3 (default) - 8.4: use PHP 8.4 - - 8.5: use PHP 8.5 + - 8.5: use PHP 8.5 -e "" Only with -s docsGenerate|functional|unit @@ -283,24 +274,24 @@ Options: Show this help. Examples: - # Run all core unit tests using PHP 7.4 + # Run all core unit tests using PHP 8.5 ./Build/Scripts/runTests.sh -s unit # Run all core units tests and enable xdebug (have a PhpStorm listening on port 9003!) ./Build/Scripts/runTests.sh -x -s unit - # Run unit tests in phpunit verbose mode with xdebug on PHP 8.1 and filter for test canRetrieveValueWithGP - ./Build/Scripts/runTests.sh -x -p 8.1 -- --filter 'classCanBeRegistered' + # Run unit tests in phpunit verbose mode with xdebug on PHP 8.3 and filter for test canRetrieveValueWithGP + ./Build/Scripts/runTests.sh -x -p 8.3 -- --filter 'classCanBeRegistered' # Run functional tests in phpunit with a filtered test method name in a specified file # example will currently execute two tests, both of which start with the search term ./Build/Scripts/runTests.sh -s functional -- --filter 'findRecordByImportSource' Tests/Functional/Repository/CategoryRepositoryTest.php - # Run functional tests on postgres with xdebug, php 8.1 and execute a restricted set of tests - ./Build/Scripts/runTests.sh -x -p 8.1 -s functional -d postgres -- Tests/Functional/Repository/CategoryRepositoryTest.php + # Run functional tests on postgres with xdebug, php 8.3 and execute a restricted set of tests + ./Build/Scripts/runTests.sh -x -p 8.3 -s functional -d postgres -- Tests/Functional/Repository/CategoryRepositoryTest.php - # Run functional tests on postgres 11 - ./Build/Scripts/runTests.sh -s functional -d postgres -i 11 + # Run functional tests on postgres 16 + ./Build/Scripts/runTests.sh -s functional -d postgres -i 16 EOF } @@ -319,17 +310,17 @@ ROOT_DIR="${PWD}" # Option defaults TEST_SUITE="" -TYPO3_VERSION="11" +TYPO3_VERSION="14" DBMS="sqlite" DBMS_VERSION="" -PHP_VERSION="8.1" +PHP_VERSION="8.3" PHP_XDEBUG_ON=0 PHP_XDEBUG_PORT=9003 EXTRA_TEST_OPTIONS="" CGLCHECK_DRY_RUN=0 DATABASE_DRIVER="" CONTAINER_BIN="" -COMPOSER_ROOT_VERSION="12.4.2" +COMPOSER_ROOT_VERSION="14.0.1" CONTAINER_INTERACTIVE="-it --init" HOST_UID=$(id -u) HOST_PID=$(id -g) @@ -369,7 +360,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; p) PHP_VERSION=${OPTARG} - if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3|8.4|8.5)$ ]]; then + if ! [[ ${PHP_VERSION} =~ ^(8.2|8.3|8.4|8.5)$ ]]; then INVALID_OPTIONS+=("-p ${OPTARG}") fi ;; @@ -378,7 +369,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; t) TYPO3_VERSION=${OPTARG} - if ! [[ ${TYPO3_VERSION} =~ ^(11|12|13)$ ]]; then + if ! [[ ${TYPO3_VERSION} =~ ^(14)$ ]]; then INVALID_OPTIONS+=("-t ${OPTARG}") fi ;; @@ -451,7 +442,7 @@ mkdir -p .cache mkdir -p .Build/public/typo3temp/var/tests IMAGE_PHP="ghcr.io/typo3/core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest" -IMAGE_ALPINE="docker.io/alpine:3.8" +IMAGE_ALPINE="docker.io/alpine:3.22" IMAGE_DOCS="ghcr.io/typo3-documentation/render-guides:latest" IMAGE_MARIADB="docker.io/mariadb:${DBMS_VERSION}" IMAGE_MYSQL="docker.io/mysql:${DBMS_VERSION}" @@ -516,17 +507,9 @@ case ${TEST_SUITE} in cleanComposer stashComposerFiles ${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 " - if [ ${TYPO3_VERSION} -eq 11 ]; then + if [ ${TYPO3_VERSION} -eq 14 ]; then composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^11.5.24 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 12 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^12.4.2 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 13 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^13.4 || exit 1 + typo3/cms-core:^14.0 || exit 1 fi composer update --no-progress --no-interaction || exit 1 composer show || exit 1 @@ -538,17 +521,9 @@ case ${TEST_SUITE} in cleanComposer stashComposerFiles ${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 " - if [ ${TYPO3_VERSION} -eq 11 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^11.5.24 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 12 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^12.4.2 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 13 ]; then + if [ ${TYPO3_VERSION} -eq 14 ]; then composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^13.4 || exit 1 + typo3/cms-core:^14.0 || exit 1 fi composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest || exit 1 composer show || exit 1 diff --git a/Classes/Form/Element/RedirectElement.php b/Classes/Form/Element/RedirectElement.php index 1684339..1d06c8d 100644 --- a/Classes/Form/Element/RedirectElement.php +++ b/Classes/Form/Element/RedirectElement.php @@ -5,17 +5,21 @@ namespace Ayacoo\RedirectTab\Form\Element; use Ayacoo\RedirectTab\Service\RedirectDemandService; +use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\UriInterface; use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; +use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Http\Uri; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Fluid\View\StandaloneView; +use TYPO3\CMS\Core\View\ViewFactoryData; +use TYPO3\CMS\Core\View\ViewFactoryInterface; +use TYPO3\CMS\Core\View\ViewInterface; use TYPO3\CMS\Redirects\Utility\RedirectConflict; class RedirectElement extends AbstractFormElement { - private StandaloneView $view; + private ViewInterface $view; public function render(): array { @@ -28,7 +32,7 @@ public function render(): array $currentPage = 1; } - $this->prepareView(); + $this->prepareView($request); $this->view->assignMultiple([ 'redirects' => $redirectDemandService->getRedirects((int)$currentPage), @@ -40,21 +44,23 @@ public function render(): array ]); $result = $this->initializeResultArray(); - $result['html'] = $this->view->render(); + $result['html'] = $this->view->render('List'); return $result; } - protected function prepareView(): void + protected function prepareView(ServerRequestInterface $request): void { - $templateName = 'List'; - $this->view = GeneralUtility::makeInstance(StandaloneView::class); - $this->view->setTemplate($templateName); - $this->view->setTemplateRootPaths(['EXT:redirect_tab/Resources/Private/Templates/Backend']); - $this->view->setPartialRootPaths(['EXT:redirect_tab/Resources/Private/Partials/Backend']); - $this->view->setLayoutRootPaths(['EXT:redirect_tab/Resources/Private/Layouts']); + $viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class); + $viewFactoryData = new ViewFactoryData( + templateRootPaths: ['EXT:redirect_tab/Resources/Private/Templates/Backend'], + partialRootPaths: ['EXT:redirect_tab/Resources/Private/Partials/Backend'], + layoutRootPaths: ['EXT:redirect_tab/Resources/Private/Layouts'], + request: $request, + ); + $this->view = $viewFactory->create($viewFactoryData); } - protected function buildRedirectUrl(int $currentPage): UriInterface|Uri + protected function buildRedirectUrl(int $currentPage): UriInterface|Uri|null { $backendUriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriParameters = [ @@ -66,6 +72,10 @@ protected function buildRedirectUrl(int $currentPage): UriInterface|Uri 'page' => $currentPage, ]; - return $backendUriBuilder->buildUriFromRoute('record_edit', $uriParameters); + try { + return $backendUriBuilder->buildUriFromRoute('record_edit', $uriParameters); + } catch (RouteNotFoundException) { + return null; + } } } diff --git a/Classes/Service/RedirectDemandService.php b/Classes/Service/RedirectDemandService.php index 42cad9e..5f86573 100644 --- a/Classes/Service/RedirectDemandService.php +++ b/Classes/Service/RedirectDemandService.php @@ -8,44 +8,18 @@ use Psr\EventDispatcher\EventDispatcherInterface; use TYPO3\CMS\Core\Site\Entity\NullSite; use TYPO3\CMS\Core\Site\Entity\Site; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Redirects\Repository\Demand; use TYPO3\CMS\Redirects\Repository\RedirectRepository; class RedirectDemandService { - protected array $data = []; - - protected ?Demand $demand = null; - - private RedirectRepository $redirectRepository; - private EventDispatcherInterface $eventDispatcher; - - public function __construct() - { - $this->redirectRepository = GeneralUtility::makeInstance(RedirectRepository::class); - $this->eventDispatcher = GeneralUtility::makeInstance(EventDispatcherInterface::class); - } - - public function getData(): array - { - return $this->data; - } - - public function setData(array $data): void - { - $this->data = $data; - } - - public function getDemand(): ?Demand - { - return $this->demand; - } - - public function setDemand(?Demand $demand): void - { - $this->demand = $demand; - } + public function __construct( + protected RedirectRepository $redirectRepository, + protected EventDispatcherInterface $eventDispatcher, + protected ?Demand $demand = null, + protected array $data = [] + ) + { } /** * @param int $page @@ -66,12 +40,10 @@ public function getRedirects(int $page = 1): array $page, 'source_host', 'asc', + Demand::DEFAULT_REDIRECT_TYPE, ['*', $host], '', 't3://page?uid=' . $this->data['effectivePid'], - [], - 0, - null ); $redirects = $this->redirectRepository->findRedirectsByDemand($this->demand); } @@ -108,4 +80,19 @@ public function preparePagination(?Demand $demand): array } return $pagination; } + + public function getData(): array + { + return $this->data; + } + + public function setData(array $data): void + { + $this->data = $data; + } + + public function getDemand(): ?Demand + { + return $this->demand; + } } diff --git a/Classes/ViewHelpers/RouteParametersViewHelper.php b/Classes/ViewHelpers/RouteParametersViewHelper.php index abe1537..be60651 100644 --- a/Classes/ViewHelpers/RouteParametersViewHelper.php +++ b/Classes/ViewHelpers/RouteParametersViewHelper.php @@ -9,8 +9,8 @@ class RouteParametersViewHelper extends AbstractViewHelper public function initializeArguments(): void { parent::initializeArguments(); - $this->registerArgument('recordUid', 'integer', 'Record Uid', true, 0); - $this->registerArgument('page', 'integer', 'Pagination Page', true, 0); + $this->registerArgument('recordUid', 'integer', 'Record Uid', true); + $this->registerArgument('page', 'integer', 'Pagination Page', true); } public function render(): array diff --git a/README.md b/README.md index 3257dbf..71ee620 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,13 @@ composer require ayacoo/redirect-tab ### 3.1 Versions and support -| redirect_tab | TYPO3 | PHP | Support / Development | -|--------------|-------|-----------|-----------------------------| -| 4.x | 13.x | 8.2 - 8.5 | features, bugfixes, security updates | -| 3.x | 12.x | 8.1 - 8.4 | bugfixes, security updates | -| 2.x | 11.x | 7.4 - 8.0 | bugfixes, security updates | -| 1.x | 10.x | 7.2 - 7.4 | no support any more | +| redirect_tab | TYPO3 | PHP | Support / Development | +|--------------|-------|-----------|--------------------------------------| +| 5.x | 14.x | 8.2 - 8.5 | features, bugfixes, security updates | +| 4.x | 13.x | 8.2 - 8.5 | bugfixes, security updates | +| 3.x | 12.x | 8.1 - 8.4 | bugfixes, security updates | +| 2.x | 11.x | 7.4 - 8.0 | no support any more | +| 1.x | 10.x | 7.2 - 7.4 | no support any more | ### 3.2 Release Management diff --git a/composer.json b/composer.json index b154a59..e21d372 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "ayacoo/redirect-tab", "type": "typo3-cms-extension", - "version": "4.0.2", + "version": "5.0.0", "description": "Show TYPO3 redirects in the page properties", "authors": [ { @@ -13,23 +13,22 @@ "license": "GPL-2.0-or-later", "require": { "php": ">=8.2 < 8.6", - "typo3/cms-core": "^13.4", - "typo3/cms-redirects": "^13.4" + "typo3/cms-core": "^14.0", + "typo3/cms-redirects": "^14.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.57.0", - "helmich/typo3-typoscript-lint": "^3.1.0", - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "phpunit/phpunit": "^11.0.3", - "saschaegerer/phpstan-typo3": "^1.10.0", - "squizlabs/php_codesniffer": "^3.8.1", + "friendsofphp/php-cs-fixer": "^3.91", + "helmich/typo3-typoscript-lint": "^3.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", + "phpunit/phpunit": "^11.5.44", + "squizlabs/php_codesniffer": "^3.13", "symfony/console": "^7.0", "symfony/translation": "^7.0", "typo3/coding-standards": "^0.5.5", - "typo3/testing-framework": "^9.0" + "typo3/testing-framework": "^9.3" }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index 8a84a9e..93ed8cc 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -8,12 +8,12 @@ 'author_email' => 'info@ayacoo.de', 'state' => 'stable', 'clearCacheOnLoad' => 0, - 'version' => '4.0.2', + 'version' => '5.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '13.0.0-13.4.99', - 'redirects' => '13.0.0-13.4.99', - 'php' => '8.2.0-8.4.99', + 'typo3' => '14.0.0-14.4.99', + 'redirects' => '14.0.0-14.4.99', + 'php' => '8.2.0-8.5.99', ], 'conflicts' => [ ], From 27973ede1afd21a9521352fdf0899636616a1359 Mon Sep 17 00:00:00 2001 From: Guido Schmechel Date: Sat, 20 Dec 2025 23:28:19 +0100 Subject: [PATCH 2/6] Fix php cs --- Build/phpunit/FunctionalTestsBootstrap.php | 1 + Build/phpunit/UnitTestsBootstrap.php | 1 + Classes/Service/RedirectDemandService.php | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Build/phpunit/FunctionalTestsBootstrap.php b/Build/phpunit/FunctionalTestsBootstrap.php index a95bc52..9882f8f 100644 --- a/Build/phpunit/FunctionalTestsBootstrap.php +++ b/Build/phpunit/FunctionalTestsBootstrap.php @@ -1,4 +1,5 @@ Date: Sun, 29 Mar 2026 16:56:14 +0200 Subject: [PATCH 3/6] Update v14 version --- Classes/Form/Element/RedirectElement.php | 3 + Classes/Service/RedirectDemandService.php | 2 +- .../RedirectAccessDisplayCondition.php | 27 +++++++++ Configuration/TCA/Overrides/pages.php | 2 + Resources/Private/Templates/Backend/List.html | 60 ++++++++++++------- .../Service/RedirectDemandServiceTest.php | 4 ++ 6 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 Classes/UserFunctions/RedirectAccessDisplayCondition.php diff --git a/Classes/Form/Element/RedirectElement.php b/Classes/Form/Element/RedirectElement.php index 1d06c8d..8f6d054 100644 --- a/Classes/Form/Element/RedirectElement.php +++ b/Classes/Form/Element/RedirectElement.php @@ -5,6 +5,7 @@ namespace Ayacoo\RedirectTab\Form\Element; use Ayacoo\RedirectTab\Service\RedirectDemandService; +use Ayacoo\RedirectTab\UserFunctions\RedirectAccessDisplayCondition; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\UriInterface; use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; @@ -34,7 +35,9 @@ public function render(): array $this->prepareView($request); + $redirectAccess = GeneralUtility::makeInstance(RedirectAccessDisplayCondition::class); $this->view->assignMultiple([ + 'canEditRedirects' => $redirectAccess->canEditRedirects(), 'redirects' => $redirectDemandService->getRedirects((int)$currentPage), 'demand' => $redirectDemandService->getDemand(), 'pagination' => $redirectDemandService->preparePagination($redirectDemandService->getDemand()), diff --git a/Classes/Service/RedirectDemandService.php b/Classes/Service/RedirectDemandService.php index 0f04785..cd7937c 100644 --- a/Classes/Service/RedirectDemandService.php +++ b/Classes/Service/RedirectDemandService.php @@ -56,7 +56,7 @@ public function preparePagination(?Demand $demand): array { $pagination = []; if ($demand !== null) { - $count = $this->redirectRepository->countRedirectsByByDemand($demand); + $count = $this->redirectRepository->countRedirectsByDemand($demand); $numberOfPages = ceil($count / $demand->getLimit()); $endRecord = $demand->getOffset() + $demand->getLimit(); if ($endRecord > $count) { diff --git a/Classes/UserFunctions/RedirectAccessDisplayCondition.php b/Classes/UserFunctions/RedirectAccessDisplayCondition.php new file mode 100644 index 0000000..0e383b2 --- /dev/null +++ b/Classes/UserFunctions/RedirectAccessDisplayCondition.php @@ -0,0 +1,27 @@ +getBackendUser()->isAdmin() || $this->getBackendUser()->check('tables_select', self::TABLE_NAME); + } + + public function canEditRedirects(): bool + { + return $this->getBackendUser()->isAdmin() || $this->getBackendUser()->check('tables_modify', self::TABLE_NAME); + } + + protected function getBackendUser(): BackendUserAuthentication + { + return $GLOBALS['BE_USER']; + } +} diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index fc8d880..bb7e0d9 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -1,5 +1,6 @@ [ 'AND' => [ 'REC:NEW:false', + 'USER:' . RedirectAccessDisplayCondition::class . '->canListRedirects', ], ], 'exclude' => true, diff --git a/Resources/Private/Templates/Backend/List.html b/Resources/Private/Templates/Backend/List.html index 865c147..0266f10 100644 --- a/Resources/Private/Templates/Backend/List.html +++ b/Resources/Private/Templates/Backend/List.html @@ -41,9 +41,16 @@ - - {redirect.source_path -> f:format.crop(maxCharacters:100)} - + + + + {redirect.source_path -> f:format.crop(maxCharacters:100)} + + + + {redirect.source_path -> f:format.crop(maxCharacters:100)} + + @@ -64,26 +71,31 @@ - + + - + + + + + + + + + + + + + + - - - - - - - - - @@ -96,9 +108,11 @@

- - - + + + + +
diff --git a/Tests/Functional/Service/RedirectDemandServiceTest.php b/Tests/Functional/Service/RedirectDemandServiceTest.php index 3e96277..0847bb4 100644 --- a/Tests/Functional/Service/RedirectDemandServiceTest.php +++ b/Tests/Functional/Service/RedirectDemandServiceTest.php @@ -6,6 +6,7 @@ use Ayacoo\RedirectTab\Service\RedirectDemandService; use PHPUnit\Framework\Attributes\Test; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Configuration\SiteConfiguration; use TYPO3\CMS\Core\Site\Entity\NullSite; @@ -24,6 +25,9 @@ final class RedirectDemandServiceTest extends FunctionalTestCase protected function setUp(): void { parent::setUp(); + $backendUserAuthentication = $this->createMock(BackendUserAuthentication::class); + $backendUserAuthentication->method('isAdmin')->withAnyParameters()->willReturn(true); + $GLOBALS['BE_USER'] = $backendUserAuthentication; $this->subject = $this->get(RedirectDemandService::class); } From e48c10c6fbccacf2a1bc55baed255b4496bb74fb Mon Sep 17 00:00:00 2001 From: Guido Schmechel Date: Sun, 29 Mar 2026 17:17:41 +0200 Subject: [PATCH 4/6] Update v14 version --- Build/Scripts/runTests.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index bbdb195..dc72ec4 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -151,7 +151,7 @@ restoreComposerFiles() { loadHelp() { # Load help text into $HELP - read -r -d '' HELP </dev/null + POSTGRES_TMPFS="/var/lib/postgresql/data" + if [[ ${DBMS_VERSION} -eq 18 ]]; then + POSTGRES_TMPFS="/var/lib/postgresql" + fi + ${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 waitFor postgres-func-${SUFFIX} 5432 CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=bamboo -e typo3DatabaseUsername=funcu -e typo3DatabaseHost=postgres-func-${SUFFIX} -e typo3DatabasePassword=funcp" ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" From dcde940e87ce842e9f91a46407993ff666c3d5c0 Mon Sep 17 00:00:00 2001 From: Guido Schmechel Date: Sun, 19 Apr 2026 12:41:30 +0200 Subject: [PATCH 5/6] Update composer info and add icon --- Resources/Public/Icons/Extension.svg | 10 ++++++++++ composer.json | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 Resources/Public/Icons/Extension.svg diff --git a/Resources/Public/Icons/Extension.svg b/Resources/Public/Icons/Extension.svg new file mode 100644 index 0000000..cc48900 --- /dev/null +++ b/Resources/Public/Icons/Extension.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/composer.json b/composer.json index e21d372..aa0098e 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "ayacoo/redirect-tab", "type": "typo3-cms-extension", "version": "5.0.0", - "description": "Show TYPO3 redirects in the page properties", + "description": "RedirectTab - Show TYPO3 redirects in the page properties", "authors": [ { "name": "Guido Schmechel", @@ -48,8 +48,8 @@ } }, "scripts": { - "ci:php:cs": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix --dry-run -v --config ./Build/php-cs-fixer/php-cs-fixer.php ./", - "ci:php:csfix": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix -v --config ./Build/php-cs-fixer/php-cs-fixer.php ./", + "ci:php:cs": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix --dry-run -v --config Build/php-cs-fixer/php-cs-fixer.php ./", + "ci:php:csfix": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix -v --config Build/php-cs-fixer/php-cs-fixer.php ./", "ci:php:lint": "find .*.php *.php Classes Configuration Tests -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l", "ci:php:sniff": "phpcs Classes Configuration Tests", "ci:php:stan": "phpstan --no-progress", From aad40e41a4d4e9b0e42645c06679791cd74703e7 Mon Sep 17 00:00:00 2001 From: Guido Schmechel Date: Fri, 24 Apr 2026 20:02:46 +0200 Subject: [PATCH 6/6] Update TYPO3 version --- composer.json | 4 ++-- ext_emconf.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index aa0098e..564f0e1 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "license": "GPL-2.0-or-later", "require": { "php": ">=8.2 < 8.6", - "typo3/cms-core": "^14.0", - "typo3/cms-redirects": "^14.0" + "typo3/cms-core": "^14.3", + "typo3/cms-redirects": "^14.3" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.91", diff --git a/ext_emconf.php b/ext_emconf.php index 93ed8cc..38a0e11 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,8 +11,8 @@ 'version' => '5.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '14.0.0-14.4.99', - 'redirects' => '14.0.0-14.4.99', + 'typo3' => '14.3.0-14.3.99', + 'redirects' => '14.3.0-14.3.99', 'php' => '8.2.0-8.5.99', ], 'conflicts' => [