From 5ecd1a421de03d5c6d91972e901f2e03af8244d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Thu, 27 Jul 2023 14:43:22 +0200 Subject: [PATCH 01/15] =?UTF-8?q?[WIP]=C2=A0Allow=20to=20be=20installed=20?= =?UTF-8?q?with=20TYPO3=2012=20LTS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 12 ++++++------ ext_emconf.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index eb1423e..05493e2 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ ], "require": { "php": "^7.2 || ^8.0", - "typo3/cms-core": "^9.5 || ^10.4.16 || ^11.5", - "typo3/cms-extbase": "^9.5 || ^10.4.16 || ^11.5", - "typo3/cms-extensionmanager": "^9.5 || ^10.4.16 || ^11.5", - "typo3/cms-fluid": "^9.5 || ^10.4.16 || ^11.5", - "mask/mask": "^4.0 || ^5.0 || ^6.0 || ^7.1" + "typo3/cms-core": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", + "typo3/cms-extbase": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", + "typo3/cms-extensionmanager": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", + "typo3/cms-fluid": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", + "mask/mask": "^4.0 || ^5.0 || ^6.0 || ^7.1 || ^8.0" }, "require-dev": { - "typo3/cms-fluid-styled-content": "^9.5 || ^10.4.16 || ^11.5", + "typo3/cms-fluid-styled-content": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", "nimut/testing-framework": "6.x-dev", "phpunit/phpunit": "^8.5" }, diff --git a/ext_emconf.php b/ext_emconf.php index d38dd51..36ff58d 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -23,8 +23,8 @@ array ( 'depends' => array ( - 'typo3' => '9.5.0-11.5.99', - 'mask' => '4.0.0-7.99.99', + 'typo3' => '9.5.0-12.4.99', + 'mask' => '4.0.0-8.99.99', ), 'conflicts' => array ( From fa015c01403e3d603840fd8a7fffee5847e306c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Thu, 27 Jul 2023 17:38:37 +0200 Subject: [PATCH 02/15] Make check for existing TYPO3 constant more tolerant --- Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php | 2 +- ext_tables.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php b/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php index b6ecd0b..f66548c 100644 --- a/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php +++ b/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php @@ -38,7 +38,7 @@ public function isEnabled($flags) public function execute($content) { return << Date: Mon, 31 Jul 2023 17:58:01 +0200 Subject: [PATCH 03/15] Update backend module registration --- Configuration/Backend/Modules.php | 18 ++++++++++++++++++ Configuration/Services.yaml | 8 ++++++++ ext_tables.php | 15 --------------- 3 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 Configuration/Backend/Modules.php create mode 100644 Configuration/Services.yaml diff --git a/Configuration/Backend/Modules.php b/Configuration/Backend/Modules.php new file mode 100644 index 0000000..5105d6b --- /dev/null +++ b/Configuration/Backend/Modules.php @@ -0,0 +1,18 @@ + [ + 'parent' => 'tools', + 'position' => ['after' => 'mask_module'], + 'access' => 'admin', + 'path' => '/module/mask_export', + 'icon' => 'EXT:mask_export/Resources/Public/Icons/Extension.svg', + 'labels' => 'LLL:EXT:mask_export/Resources/Private/Language/locallang_mod.xlf', + 'extensionName' => 'MaskExport', + 'controllerActions' => [ + \IchHabRecht\MaskExport\Controller\ExportController::class => [ + 'list', 'save', 'download', 'install' + ] + ], + ], +]; diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml new file mode 100644 index 0000000..87a4008 --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,8 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + IchHabRecht\MaskExport\: + resource: '../Classes/*' diff --git a/ext_tables.php b/ext_tables.php index f164264..f0b6723 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -3,21 +3,6 @@ defined('TYPO3_MODE') || defined('TYPO3') || die('Access denied.'); call_user_func(static function () { - TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( - 'IchHabRecht.mask_export', - 'tools', - 'mask_export', - 'after:MaskMask', - [ - \IchHabRecht\MaskExport\Controller\ExportController::class => 'list, save, download, install', - ], - [ - 'access' => 'admin', - 'icon' => 'EXT:mask_export/Resources/Public/Icons/Extension.svg', - 'labels' => 'LLL:EXT:mask_export/Resources/Private/Language/locallang_mod.xlf', - ] - ); - $maskElements = array_filter( $GLOBALS['TCA']['tt_content']['types'] ?? [], static function ($key) { From 1abc42620e2642aef22a554f58f1e05120c04ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Tue, 1 Aug 2023 09:19:27 +0200 Subject: [PATCH 04/15] Allow to open backend module in TYPO3 12 --- .../ExtensionConfigurationAggregate.php | 10 +++--- Classes/CodeGenerator/HtmlCodeGenerator.php | 28 +++------------- Classes/Controller/ExportController.php | 33 ++++++++++++------- Configuration/Backend/Modules.php | 2 +- Configuration/Services.yaml | 3 ++ Resources/Private/Layouts/Default.html | 12 +++---- 6 files changed, 41 insertions(+), 47 deletions(-) diff --git a/Classes/Aggregate/ExtensionConfigurationAggregate.php b/Classes/Aggregate/ExtensionConfigurationAggregate.php index c1696cc..7e91ae8 100644 --- a/Classes/Aggregate/ExtensionConfigurationAggregate.php +++ b/Classes/Aggregate/ExtensionConfigurationAggregate.php @@ -102,11 +102,11 @@ protected function addComposerJson() 'type' => 'typo3-cms-extension', 'license' => 'GPL-2.0-or-later', 'require' => [ - 'typo3/cms-backend' => '^' . TYPO3_branch, - 'typo3/cms-core' => '^' . TYPO3_branch, - 'typo3/cms-extbase' => '^' . TYPO3_branch, - 'typo3/cms-fluid' => '^' . TYPO3_branch, - 'typo3/cms-frontend' => '^' . TYPO3_branch, + 'typo3/cms-backend' => '^' . $this->typo3Version->getBranch(), + 'typo3/cms-core' => '^' . $this->typo3Version->getBranch(), + 'typo3/cms-extbase' => '^' . $this->typo3Version->getBranch(), + 'typo3/cms-fluid' => '^' . $this->typo3Version->getBranch(), + 'typo3/cms-frontend' => '^' . $this->typo3Version->getBranch(), ], 'replace' => [ 'typo3-ter/mask' => 'self.version', diff --git a/Classes/CodeGenerator/HtmlCodeGenerator.php b/Classes/CodeGenerator/HtmlCodeGenerator.php index 634a16a..e95dc69 100644 --- a/Classes/CodeGenerator/HtmlCodeGenerator.php +++ b/Classes/CodeGenerator/HtmlCodeGenerator.php @@ -18,8 +18,7 @@ * LICENSE file that was distributed with this source code. */ -use MASK\Mask\Domain\Repository\StorageRepository; -use MASK\Mask\Helper\FieldHelper; +use MASK\Mask\Definition\TableDefinitionCollection; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -27,25 +26,8 @@ */ class HtmlCodeGenerator { - /** - * @var FieldHelper - */ - protected $fieldHelper; - - /** - * @var StorageRepository - */ - protected $storageRepository; - - public function __construct(StorageRepository $storageRepository = null, FieldHelper $fieldHelper = null) + public function __construct(protected TableDefinitionCollection $tableDefinitionCollection) { - $this->storageRepository = $storageRepository ?: GeneralUtility::makeInstance(StorageRepository::class); - - if (method_exists($this->storageRepository, 'getFormType')) { - $this->fieldHelper = $this->storageRepository; - } else { - $this->fieldHelper = $fieldHelper ?: GeneralUtility::makeInstance(FieldHelper::class, $this->storageRepository); - } } /** @@ -57,7 +39,7 @@ public function __construct(StorageRepository $storageRepository = null, FieldHe */ public function generateHtml($key, $table = 'tt_content') { - $storage = $this->storageRepository->loadElement('tt_content', $key); + $storage = $this->tableDefinitionCollection->loadElement('tt_content', $key)->toArray(); $html = ''; if (!empty($storage['tca'])) { foreach ($storage['tca'] as $fieldKey => $fieldConfig) { @@ -83,7 +65,7 @@ public function generateHtml($key, $table = 'tt_content') */ protected function generateFieldHtml($fieldKey, $elementKey, $table = 'tt_content', $datafield = 'data') { - $formType = strtolower($this->fieldHelper->getFormType($fieldKey, $elementKey, $table)); + $formType = strtolower((string)$this->tableDefinitionCollection->getFieldType($fieldKey, $table, $elementKey)); if (in_array($formType, ['linebreak', 'tab'], true)) { return ''; } @@ -161,7 +143,7 @@ protected function generateFieldHtml($fieldKey, $elementKey, $table = 'tt_conten break; case 'inline': - $inlineFields = $this->storageRepository->loadInlineFields($fieldKey); + $inlineFields = $this->tableDefinitionCollection->loadInlineFields($fieldKey); $inlineFieldsHtml = ''; $datafieldInline = strtr($datafield, '.', '_'); if (!empty($inlineFields)) { diff --git a/Classes/Controller/ExportController.php b/Classes/Controller/ExportController.php index 2bbfef9..78fc58c 100644 --- a/Classes/Controller/ExportController.php +++ b/Classes/Controller/ExportController.php @@ -33,11 +33,15 @@ use IchHabRecht\MaskExport\FileCollection\PlainTextFileCollection; use IchHabRecht\MaskExport\FileCollection\SqlFileCollection; use MASK\Mask\Domain\Repository\StorageRepository; +use Psr\Http\Message\ResponseInterface; use Symfony\Component\Finder\Finder; +use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Messaging\AbstractMessage; +use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Http\ForwardResponse; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extensionmanager\Domain\Model\Extension; @@ -81,25 +85,28 @@ class ExportController extends ActionController */ protected $maskConfiguration; - public function __construct(StorageRepository $storageRepository) - { + public function __construct( + StorageRepository $storageRepository, + protected readonly PageRenderer $pageRenderer, + protected readonly ModuleTemplateFactory $moduleTemplateFactory + ) { $this->maskConfiguration = (array)$storageRepository->load(); } - /** - * @param string $vendorName - * @param string $extensionName - * @param array $elements - */ - public function listAction($vendorName = '', $extensionName = '', $elements = []) - { + public function listAction( + string $vendorName = '', + string $extensionName = '', + array $elements = [] + ): ResponseInterface { $extensionName = $extensionName ?: $this->getExtensionName(); $vendorName = $vendorName ?: $this->getVendorName(); $elements = $elements ?: $this->getElements(); $files = $this->getFiles($vendorName, $extensionName, $elements); - $this->view->assignMultiple( + $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $moduleTemplate->setTitle('Mask Export'); + $moduleTemplate->assignMultiple( [ 'composerMode' => Environment::isComposerMode(), 'vendorName' => $vendorName, @@ -109,6 +116,10 @@ public function listAction($vendorName = '', $extensionName = '', $elements = [] 'files' => $files, ] ); + + $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/MaskExport/Toggler'); + $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal'); + return $moduleTemplate->renderResponse(); } /** @@ -142,7 +153,7 @@ public function saveAction($vendorName = '', $extensionName = '', $elements = [] } } - $this->forward($action, null, null, ['vendorName' => $vendorName, 'extensionName' => $extensionName, 'elements' => $elements]); + return new ForwardResponse($action); } /** diff --git a/Configuration/Backend/Modules.php b/Configuration/Backend/Modules.php index 5105d6b..9eb0bab 100644 --- a/Configuration/Backend/Modules.php +++ b/Configuration/Backend/Modules.php @@ -5,7 +5,7 @@ 'parent' => 'tools', 'position' => ['after' => 'mask_module'], 'access' => 'admin', - 'path' => '/module/mask_export', + 'path' => '/module/MaskExport', 'icon' => 'EXT:mask_export/Resources/Public/Icons/Extension.svg', 'labels' => 'LLL:EXT:mask_export/Resources/Private/Language/locallang_mod.xlf', 'extensionName' => 'MaskExport', diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 87a4008..bbd05cd 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -6,3 +6,6 @@ services: IchHabRecht\MaskExport\: resource: '../Classes/*' + + IchHabRecht\MaskExport\CodeGenerator\HtmlCodeGenerator: + public: true diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html index 05ed24e..353e664 100644 --- a/Resources/Private/Layouts/Default.html +++ b/Resources/Private/Layouts/Default.html @@ -1,8 +1,6 @@ - -
-
-
- -
+
+
+
+
- +
From f06bf01f62c34e2b83ad5a72040c2ff4ccb183d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Tue, 1 Aug 2023 14:35:40 +0200 Subject: [PATCH 05/15] Write extension files when triggered in backend module --- Classes/Controller/ExportController.php | 53 ++++++++------------ Resources/Private/Templates/Export/List.html | 12 +++-- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/Classes/Controller/ExportController.php b/Classes/Controller/ExportController.php index 78fc58c..ba5da00 100644 --- a/Classes/Controller/ExportController.php +++ b/Classes/Controller/ExportController.php @@ -122,13 +122,11 @@ public function listAction( return $moduleTemplate->renderResponse(); } - /** - * @param string $vendorName - * @param string $extensionName - * @param array $elements - */ - public function saveAction($vendorName = '', $extensionName = '', $elements = []) - { + public function saveAction( + string $vendorName = '', + string $extensionName = '', + array $elements = [] + ): ResponseInterface { if (empty($vendorName)) { $vendorName = $this->getVendorName(); } else { @@ -146,8 +144,8 @@ public function saveAction($vendorName = '', $extensionName = '', $elements = [] $backendUser->writeUC(); $action = 'list'; - if ($this->request->hasArgument('submit')) { - $submit = strtolower($this->request->getArgument('submit')); + if ($this->request->hasArgument('submitted')) { + $submit = strtolower($this->request->getArgument('submitted')); if (in_array($submit, ['download', 'install'], true)) { $action = $submit; } @@ -156,12 +154,7 @@ public function saveAction($vendorName = '', $extensionName = '', $elements = [] return new ForwardResponse($action); } - /** - * @param string $vendorName - * @param string $extensionName - * @param array $elements - */ - public function downloadAction($vendorName, $extensionName, $elements) + public function downloadAction(string $vendorName, string $extensionName, array $elements): void { $files = $this->getFiles($vendorName, $extensionName, $elements); @@ -185,25 +178,23 @@ public function downloadAction($vendorName, $extensionName, $elements) exit; } - /** - * @param string $vendorName - * @param string $extensionName - * @param array $elements - */ - public function installAction($vendorName, $extensionName, $elements) + public function installAction(string $vendorName, string $extensionName, array $elements): ResponseInterface { - $paths = Extension::returnInstallPaths(); - if (empty($paths['Local']) || !file_exists($paths['Local'])) { - throw new \RuntimeException('Local extension install path is missing', 1500061028); + if (Environment::isComposerMode()) { + $vendorFolder = strtolower($vendorName) . '/' . $extensionName; + $extensionPath = Environment::getComposerRootPath() . '/vendor/' . $vendorFolder; + } else { + $paths = Extension::returnInstallPaths(); + if (empty($paths['Local']) || !file_exists($paths['Local'])) { + throw new \RuntimeException('Local extension install path is missing', 1500061028); + } + $extensionPath = $paths['Local'] . $extensionName; } - - $extensionPath = $paths['Local'] . $extensionName; $files = $this->getFiles($vendorName, $extensionName, $elements); $this->writeExtensionFilesToPath($files, $extensionPath); - $objectManager = GeneralUtility::makeInstance(ObjectManager::class); if (!Environment::isComposerMode()) { - $managementService = $objectManager->get(ExtensionManagementService::class); + $managementService = GeneralUtility::makeInstance(ExtensionManagementService::class); $managementService->reloadPackageInformation($extensionName); $extension = $managementService->getExtension($extensionName); $installInformation = $managementService->installExtension($extension); @@ -222,17 +213,17 @@ public function installAction($vendorName, $extensionName, $elements) ); } } else { - $installUtility = $objectManager->get(InstallUtility::class); + $installUtility = GeneralUtility::makeInstance(InstallUtility::class); $installUtility->reloadCaches(); $this->addFlashMessage( '', - 'Extension files of ' . $extensionName . ' were written successfully', + 'Extension files were succesfully written to ' . $vendorFolder, AbstractMessage::OK ); } - $this->redirect('list'); + return $this->redirect('list'); } /** diff --git a/Resources/Private/Templates/Export/List.html b/Resources/Private/Templates/Export/List.html index 6ebd308..b7d88d6 100644 --- a/Resources/Private/Templates/Export/List.html +++ b/Resources/Private/Templates/Export/List.html @@ -3,6 +3,8 @@

Mask Export

+ +
@@ -32,17 +34,17 @@

Mask Export

- - + + - + - + - +
From 15d795708a82186592a83bf1feac4ceff204db05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Tue, 1 Aug 2023 14:38:25 +0200 Subject: [PATCH 06/15] Simplify requirements to PHP 8, TYPO3 12 and mask 8 --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 05493e2..3f2b0f9 100644 --- a/composer.json +++ b/composer.json @@ -19,15 +19,15 @@ } ], "require": { - "php": "^7.2 || ^8.0", - "typo3/cms-core": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", - "typo3/cms-extbase": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", - "typo3/cms-extensionmanager": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", - "typo3/cms-fluid": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", - "mask/mask": "^4.0 || ^5.0 || ^6.0 || ^7.1 || ^8.0" + "php": "^8.0", + "typo3/cms-core": "^12.4", + "typo3/cms-extbase": "^12.4", + "typo3/cms-extensionmanager": "^12.4", + "typo3/cms-fluid": "^12.4", + "mask/mask": "^8.0" }, "require-dev": { - "typo3/cms-fluid-styled-content": "^9.5 || ^10.4.16 || ^11.5 || ^12.4", + "typo3/cms-fluid-styled-content": "^12.4", "nimut/testing-framework": "6.x-dev", "phpunit/phpunit": "^8.5" }, From 8d0f59071ce4802edaf5d0d4ba953fbc1861ebd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Tue, 1 Aug 2023 14:51:22 +0200 Subject: [PATCH 07/15] Simplify TYPO3 constant based access check --- Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php | 2 +- ext_tables.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php b/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php index f66548c..c66c460 100644 --- a/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php +++ b/Classes/FlagResolver/PhpFileFlag/DefinedTypo3ModeFlag.php @@ -38,7 +38,7 @@ public function isEnabled($flags) public function execute($content) { return << Date: Tue, 1 Aug 2023 15:03:38 +0200 Subject: [PATCH 08/15] Work on tests --- .travis.yml | 6 +-- .../AbstractExportControllerTestCase.php | 53 +++++++++---------- .../FileCollection/PhpFileCollectionTest.php | 7 ++- composer.json | 5 +- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40d771e..fc886ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,7 @@ jobs: echo "Running unit tests"; echo; echo; - .Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --testsuite unit; + .Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php --testsuite unit; fi - > @@ -63,7 +63,7 @@ jobs: echo "Running functional tests"; echo; echo; - find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTestsBootstrap.php {}'; + find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php {}'; fi - > @@ -179,7 +179,7 @@ jobs: echo "Running unit tests"; echo; echo; - .Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --log-junit .Log/junit/unit_$VERSION.xml --coverage-php .Log/coverage/unit_$VERSION.cov --testsuite unit; + .Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php --log-junit .Log/junit/unit_$VERSION.xml --coverage-php .Log/coverage/unit_$VERSION.cov --testsuite unit; fi if [ -d "Tests/Functional" ]; then diff --git a/Tests/Functional/Controller/AbstractExportControllerTestCase.php b/Tests/Functional/Controller/AbstractExportControllerTestCase.php index b016258..e5f9925 100644 --- a/Tests/Functional/Controller/AbstractExportControllerTestCase.php +++ b/Tests/Functional/Controller/AbstractExportControllerTestCase.php @@ -18,23 +18,28 @@ */ use IchHabRecht\MaskExport\Controller\ExportController; -use Nimut\TestingFramework\TestCase\FunctionalTestCase; use PHPUnit\Framework\MockObject\MockBuilder; use Prophecy\Argument; +use TYPO3\CMS\Backend\Routing\Route; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Database\Schema\SchemaMigrator; use TYPO3\CMS\Core\Database\Schema\SqlReader; +use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Localization\LanguageStore; use TYPO3\CMS\Core\Localization\Locales; use TYPO3\CMS\Core\Localization\LocalizationFactory; use TYPO3\CMS\Core\Package\PackageManager; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters; use TYPO3\CMS\Extbase\Mvc\Request; use TYPO3\CMS\Extbase\Mvc\Response; use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Fluid\View\TemplateView; +use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; abstract class AbstractExportControllerTestCase extends FunctionalTestCase { @@ -43,10 +48,7 @@ abstract class AbstractExportControllerTestCase extends FunctionalTestCase */ protected $runTestInSeparateProcess = true; - /** - * @var array - */ - protected $configurationToUseInTestInstance = [ + protected array $configurationToUseInTestInstance = [ 'EXTENSIONS' => [ 'mask' => [ 'json' => 'typo3conf/ext/mask_export/Tests/Functional/Fixtures/Configuration/mask-default.json', @@ -58,22 +60,13 @@ abstract class AbstractExportControllerTestCase extends FunctionalTestCase ], ]; - /** - * @var array - */ - protected $coreExtensionsToLoad = [ + protected array $coreExtensionsToLoad = [ 'fluid_styled_content', ]; - /** - * @var array - */ - protected $files = []; + protected array $files = []; - /** - * @var array - */ - protected $testExtensionsToLoad = [ + protected array $testExtensionsToLoad = [ 'typo3conf/ext/mask', 'typo3conf/ext/mask_export', ]; @@ -85,22 +78,28 @@ protected function setUp(): void { parent::setUp(); - $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $GLOBALS['LANG'] = $this->getLanguageService(); + $GLOBALS['BE_USER'] = $this->createMock(BackendUserAuthentication::class); - $request = new Request('IchHabRecht\\MaskExport\\Controller\\ExportController'); - $request->setControllerObjectName('IchHabRecht\\MaskExport\\Controller\\ExportController'); - $request->setControllerActionName('list'); - $request->setFormat('html'); - if (method_exists($request, 'setControllerAliasToClassNameMapping')) { - $request->setControllerAliasToClassNameMapping(['Export' => ExportController::class]); - } + $route = new Route('', []); + $route->setOption('packageName', 'mask_export'); + + $serverRequest = new ServerRequest(); + $serverRequest = $serverRequest->withAttribute('extbase', new ExtbaseRequestParameters()); + $serverRequest = $serverRequest->withAttribute('route', $route); + $serverRequest = $serverRequest->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE); + + $request = new Request($serverRequest); + $request = $request->withControllerObjectName('IchHabRecht\\MaskExport\\Controller\\ExportController'); + $request = $request->withControllerActionName('list'); + $request = $request->withFormat('html'); $response = null; if (class_exists('TYPO3\\CMS\\Extbase\\Mvc\\Response')) { $response = new Response(); } - $view = $objectManager->get(TemplateView::class); + $view = GeneralUtility::makeInstance(TemplateView::class); $view->setLayoutRootPaths(['EXT:mask_export/Resources/Private/Layouts']); $view->setTemplateRootPaths(['EXT:mask_export/Tests/Functional/Fixtures/Templates']); if (method_exists(GeneralUtility::class, 'getContainer')) { @@ -110,7 +109,7 @@ protected function setUp(): void GeneralUtility::addInstance(TemplateView::class, $view); } - $subject = $objectManager->get(ExportController::class); + $subject = GeneralUtility::makeInstance(ExportController::class); $response = $subject->processRequest($request, $response) ?: $response; $closure = \Closure::bind(function () use ($view) { diff --git a/Tests/Unit/FileCollection/PhpFileCollectionTest.php b/Tests/Unit/FileCollection/PhpFileCollectionTest.php index e1a65eb..8529780 100644 --- a/Tests/Unit/FileCollection/PhpFileCollectionTest.php +++ b/Tests/Unit/FileCollection/PhpFileCollectionTest.php @@ -20,11 +20,14 @@ use IchHabRecht\MaskExport\Aggregate\PhpAwareInterface; use IchHabRecht\MaskExport\FileCollection\PhpFileCollection; use IchHabRecht\MaskExport\FlagResolver\PhpFileFlagResolver; -use Nimut\TestingFramework\TestCase\UnitTestCase; +use Prophecy\PhpUnit\ProphecyTrait; use TYPO3\CMS\Core\Service\DependencyOrderingService; +use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class PhpFileCollectionTest extends UnitTestCase { + use ProphecyTrait; + /** * @test */ @@ -60,7 +63,7 @@ public function getFilesCombinesPhpFileFlags() $files = $phpFileCollection->getFiles(); $this->assertArrayHasKey('ext_tables.php', $files); - $this->assertStringContainsString('defined(\'TYPO3_MODE\') || die();', $files['ext_tables.php']); + $this->assertStringContainsString('defined(\'TYPO3\') || die();', $files['ext_tables.php']); $this->assertStringContainsString('call_user_func(static function () {', $files['ext_tables.php']); } } diff --git a/composer.json b/composer.json index 3f2b0f9..ae7d6e2 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,9 @@ }, "require-dev": { "typo3/cms-fluid-styled-content": "^12.4", - "nimut/testing-framework": "6.x-dev", - "phpunit/phpunit": "^8.5" + "typo3/testing-framework": "^7.0", + "phpunit/phpunit": "^9.6", + "phpspec/prophecy-phpunit": "^2.0" }, "replace": { "typo3-ter/mask-export": "self.version" From 9b5fe3967d62aafb466f4aa50a6d0343d46bd77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Wed, 2 Aug 2023 10:48:25 +0200 Subject: [PATCH 09/15] Make export run without PHP errors --- Classes/Aggregate/AbstractInlineContentAggregate.php | 3 ++- Classes/CodeGenerator/HtmlCodeGenerator.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/Aggregate/AbstractInlineContentAggregate.php b/Classes/Aggregate/AbstractInlineContentAggregate.php index 7e6ce92..b893b1c 100644 --- a/Classes/Aggregate/AbstractInlineContentAggregate.php +++ b/Classes/Aggregate/AbstractInlineContentAggregate.php @@ -30,7 +30,8 @@ protected function getAvailableInlineFields() continue; } foreach ($configuration['tca'] as $field => $fieldConfiguration) { - if ('inline' === $fieldConfiguration['config']['type'] + if (isset($fieldConfiguration['config']['type']) + && 'inline' === $fieldConfiguration['config']['type'] && 'tt_content' === $fieldConfiguration['config']['foreign_table'] ) { if (empty($inlineFields[$table])) { diff --git a/Classes/CodeGenerator/HtmlCodeGenerator.php b/Classes/CodeGenerator/HtmlCodeGenerator.php index e95dc69..4b0ea16 100644 --- a/Classes/CodeGenerator/HtmlCodeGenerator.php +++ b/Classes/CodeGenerator/HtmlCodeGenerator.php @@ -143,11 +143,11 @@ protected function generateFieldHtml($fieldKey, $elementKey, $table = 'tt_conten break; case 'inline': - $inlineFields = $this->tableDefinitionCollection->loadInlineFields($fieldKey); + $inlineFields = $this->tableDefinitionCollection->loadInlineFields($fieldKey, $elementKey); $inlineFieldsHtml = ''; $datafieldInline = strtr($datafield, '.', '_'); if (!empty($inlineFields)) { - foreach ($inlineFields as $inlineField) { + foreach ($inlineFields->toArray() as $inlineField) { $inlineFieldsHtml .= $this->generateFieldHtml($inlineField['maskKey'], $elementKey, $fieldKey, $datafieldInline . '_item.data'); } } From 108f0a22e07874a4741d12c4f852a1d803e37cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Thu, 3 Aug 2023 20:56:01 +0200 Subject: [PATCH 10/15] Reintroduce compatibility with TYPO3 11 --- composer.json | 10 +++++----- ext_emconf.php | 4 ++-- ext_tables.php | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index ae7d6e2..2f944c1 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ ], "require": { "php": "^8.0", - "typo3/cms-core": "^12.4", - "typo3/cms-extbase": "^12.4", - "typo3/cms-extensionmanager": "^12.4", - "typo3/cms-fluid": "^12.4", + "typo3/cms-core": "^11.5 || ^12.4", + "typo3/cms-extbase": "^11.5 || ^12.4", + "typo3/cms-extensionmanager": "^11.5 || ^12.4", + "typo3/cms-fluid": "^11.5 || ^12.4", "mask/mask": "^8.0" }, "require-dev": { - "typo3/cms-fluid-styled-content": "^12.4", + "typo3/cms-fluid-styled-content": "^11.5 || ^12.4", "typo3/testing-framework": "^7.0", "phpunit/phpunit": "^9.6", "phpspec/prophecy-phpunit": "^2.0" diff --git a/ext_emconf.php b/ext_emconf.php index 36ff58d..7ec0889 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -23,8 +23,8 @@ array ( 'depends' => array ( - 'typo3' => '9.5.0-12.4.99', - 'mask' => '4.0.0-8.99.99', + 'typo3' => '11.5.0-12.4.99', + 'mask' => '8.0.0-8.99.99', ), 'conflicts' => array ( diff --git a/ext_tables.php b/ext_tables.php index e2b9881..d1531fa 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -3,6 +3,21 @@ defined('TYPO3') || die(); call_user_func(static function () { + TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( + 'IchHabRecht.mask_export', + 'tools', + 'mask_export', + 'after:MaskMask', + [ + \IchHabRecht\MaskExport\Controller\ExportController::class => 'list, save, download, install', + ], + [ + 'access' => 'admin', + 'icon' => 'EXT:mask_export/Resources/Public/Icons/Extension.svg', + 'labels' => 'LLL:EXT:mask_export/Resources/Private/Language/locallang_mod.xlf', + ] + ); + $maskElements = array_filter( $GLOBALS['TCA']['tt_content']['types'] ?? [], static function ($key) { From 160ba4549984aa04183bccd1364e4c6e36307754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Thu, 3 Aug 2023 22:20:30 +0200 Subject: [PATCH 11/15] Get access to $view and variables in AbstractExportControllerTestCase again --- Classes/Controller/ExportController.php | 19 ++++++- .../AbstractExportControllerTestCase.php | 54 ++++++++++++++----- .../Fixtures/Templates/Export/List.html | 1 + 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/Classes/Controller/ExportController.php b/Classes/Controller/ExportController.php index ba5da00..03f80b2 100644 --- a/Classes/Controller/ExportController.php +++ b/Classes/Controller/ExportController.php @@ -35,6 +35,7 @@ use MASK\Mask\Domain\Repository\StorageRepository; use Psr\Http\Message\ResponseInterface; use Symfony\Component\Finder\Finder; +use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Core\Environment; @@ -85,6 +86,8 @@ class ExportController extends ActionController */ protected $maskConfiguration; + protected ?ModuleTemplate $moduleTemplate = null; + public function __construct( StorageRepository $storageRepository, protected readonly PageRenderer $pageRenderer, @@ -93,6 +96,11 @@ public function __construct( $this->maskConfiguration = (array)$storageRepository->load(); } + public function setModuleTemplate(ModuleTemplate $moduleTemplate) + { + $this->moduleTemplate = $moduleTemplate; + } + public function listAction( string $vendorName = '', string $extensionName = '', @@ -104,7 +112,7 @@ public function listAction( $files = $this->getFiles($vendorName, $extensionName, $elements); - $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $moduleTemplate = $this->getModuleTemplate(); $moduleTemplate->setTitle('Mask Export'); $moduleTemplate->assignMultiple( [ @@ -544,4 +552,13 @@ protected function getBackendUser() { return $GLOBALS['BE_USER']; } + + protected function getModuleTemplate(): ModuleTemplate + { + if (!$this->moduleTemplate) { + $this->moduleTemplate = $this->moduleTemplateFactory->create($this->request); + } + + return $this->moduleTemplate; + } } diff --git a/Tests/Functional/Controller/AbstractExportControllerTestCase.php b/Tests/Functional/Controller/AbstractExportControllerTestCase.php index e5f9925..282fa46 100644 --- a/Tests/Functional/Controller/AbstractExportControllerTestCase.php +++ b/Tests/Functional/Controller/AbstractExportControllerTestCase.php @@ -20,29 +20,43 @@ use IchHabRecht\MaskExport\Controller\ExportController; use PHPUnit\Framework\MockObject\MockBuilder; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; +use TYPO3\CMS\Backend\Module\ModuleProvider; use TYPO3\CMS\Backend\Routing\Route; +use TYPO3\CMS\Backend\Routing\UriBuilder; +use TYPO3\CMS\Backend\Template\ModuleTemplate; +use TYPO3\CMS\Backend\View\BackendViewFactory; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; +use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Database\Schema\SchemaMigrator; use TYPO3\CMS\Core\Database\Schema\SqlReader; use TYPO3\CMS\Core\Http\ServerRequest; +use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Localization\LanguageStore; use TYPO3\CMS\Core\Localization\Locales; use TYPO3\CMS\Core\Localization\LocalizationFactory; +use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Package\PackageManager; +use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\View\FluidViewAdapter; use TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters; use TYPO3\CMS\Extbase\Mvc\Request; use TYPO3\CMS\Extbase\Mvc\Response; use TYPO3\CMS\Extbase\Object\ObjectManager; +use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext; +use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory; use TYPO3\CMS\Fluid\View\TemplateView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; abstract class AbstractExportControllerTestCase extends FunctionalTestCase { + use ProphecyTrait; + /** * @var bool */ @@ -99,23 +113,18 @@ protected function setUp(): void $response = new Response(); } - $view = GeneralUtility::makeInstance(TemplateView::class); + $renderingContext = GeneralUtility::makeInstance(RenderingContextFactory::class)->create(); + $renderingContext->setControllerName('Export'); + $renderingContext->setControllerAction('list'); + + $view = GeneralUtility::makeInstance(TemplateView::class, $renderingContext); $view->setLayoutRootPaths(['EXT:mask_export/Resources/Private/Layouts']); $view->setTemplateRootPaths(['EXT:mask_export/Tests/Functional/Fixtures/Templates']); - if (method_exists(GeneralUtility::class, 'getContainer')) { - $container = GeneralUtility::getContainer(); - $container->set(TemplateView::class, $view); - } else { - GeneralUtility::addInstance(TemplateView::class, $view); - } $subject = GeneralUtility::makeInstance(ExportController::class); + $subject->setModuleTemplate($this->buildModuleTemplateWithViewAndRequest($view, $request)); $response = $subject->processRequest($request, $response) ?: $response; - $closure = \Closure::bind(function () use ($view) { - return $view->baseRenderingContext; - }, null, TemplateView::class); - $renderingContext = $closure(); $variables = $renderingContext->getVariableProvider(); $this->files = $variables->get('files'); } @@ -180,9 +189,30 @@ protected function getLanguageService(bool $mockBuilder = false) ); } - $languageService = new LanguageService(new Locales(), new LocalizationFactory(new LanguageStore($packageManager), $cacheManagerProphecy->reveal()), $cacheFrontendProphecy->reveal()); + $languageService = new LanguageService( + new Locales(), + new LocalizationFactory( + new LanguageStore($packageManager), + $cacheManagerProphecy->reveal() + ), + $cacheFrontendProphecy->reveal() + ); $languageService->init('default'); return $languageService; } + + protected function buildModuleTemplateWithViewAndRequest(TemplateView $view, Request $request): ModuleTemplate + { + return new ModuleTemplate( + GeneralUtility::makeInstance(PageRenderer::class), + GeneralUtility::makeInstance(IconFactory::class), + GeneralUtility::makeInstance(UriBuilder::class), + GeneralUtility::makeInstance(ModuleProvider::class), + GeneralUtility::makeInstance(FlashMessageService::class), + GeneralUtility::makeInstance(ExtensionConfiguration::class), + new FluidViewAdapter($view), + $request + ); + } } diff --git a/Tests/Functional/Fixtures/Templates/Export/List.html b/Tests/Functional/Fixtures/Templates/Export/List.html index e69de29..17eba4b 100644 --- a/Tests/Functional/Fixtures/Templates/Export/List.html +++ b/Tests/Functional/Fixtures/Templates/Export/List.html @@ -0,0 +1 @@ + From 63a065ab30b35d29876d95fdc19c67804e3f8b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Mon, 7 Aug 2023 15:33:27 +0200 Subject: [PATCH 12/15] Allow new TCA parent structure which was introduced in mask 8 --- .../Aggregate/AbstractOverridesAggregate.php | 5 ++- Classes/Aggregate/TcaAwareTrait.php | 41 ++++++++++++++----- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Classes/Aggregate/AbstractOverridesAggregate.php b/Classes/Aggregate/AbstractOverridesAggregate.php index 14014f2..d7fb1ef 100644 --- a/Classes/Aggregate/AbstractOverridesAggregate.php +++ b/Classes/Aggregate/AbstractOverridesAggregate.php @@ -39,9 +39,12 @@ protected function addTableColumns(array $tableConfiguration) return; } + // allow new TCA parent structure which was introduced in mask 8 + $allowedTableFields = array_merge($this->maskConfiguration[$this->table]['tca'], ['tx_mask_content_parent_uid' => []]); + $newTableFields = array_intersect_key( $tableConfiguration['columns'], - $this->maskConfiguration[$this->table]['tca'] + $allowedTableFields, ); if (empty($newTableFields)) { return; diff --git a/Classes/Aggregate/TcaAwareTrait.php b/Classes/Aggregate/TcaAwareTrait.php index 16cb354..3355997 100644 --- a/Classes/Aggregate/TcaAwareTrait.php +++ b/Classes/Aggregate/TcaAwareTrait.php @@ -17,6 +17,9 @@ * LICENSE file that was distributed with this source code. */ +use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; +use TYPO3\CMS\Core\Utility\VersionNumberUtility; + trait TcaAwareTrait { use LanguageAwareTrait; @@ -86,17 +89,33 @@ protected function addFieldSqlDefinition(array $tableConfiguration, $field) && 'inline' === $this->maskConfiguration[$table]['tca'][$field]['config']['type'] && 'tt_content' === $this->maskConfiguration[$table]['tca'][$field]['config']['foreign_table'] ) { - $this->addSqlDefinition( - 'tt_content', - $field . '_parent', - $definition - ); - $this->addSqlDefinitions( - 'tt_content', - [ - 'KEY ' . $field . '_parent' => '(' . $field . '_parent,pid,deleted)', - ] - ); + // allow new TCA parent structure which was introduced in mask 8 + $maskVersion = preg_replace('/[^0-9\.]/', '', ExtensionManagementUtility::getExtensionVersion('mask')); + if (version_compare($maskVersion, '8.0.0', '>=')) { + $this->maskConfiguration['tt_content']['tx_mask_content_parent_uid'] = [ + 'config' => [ + 'type' => 'passthrough', + ], + ]; + $this->addSqlDefinitions('tt_content', [ + 'tx_mask_content_parent_uid' => 'int(11) unsigned DEFAULT \'0\' NOT NULL', + 'tx_mask_content_role' => 'varchar(255) DEFAULT \'\' NOT NULL', + 'tx_mask_content_tablenames' => 'varchar(255) DEFAULT \'\' NOT NULL', + 'KEY tx_mask_content_parent_uid' => '(tx_mask_content_parent_uid)', + ]); + } else { + $this->addSqlDefinition( + 'tt_content', + $field . '_parent', + $definition + ); + $this->addSqlDefinitions( + 'tt_content', + [ + 'KEY ' . $field . '_parent' => '(' . $field . '_parent,pid,deleted)', + ] + ); + } } } From 371c5053e9218b3038b22a6482c8cb4d518b208c Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 23 Aug 2023 16:44:52 +0200 Subject: [PATCH 13/15] [FIX] add dataProcessing for fields of type 'file' --- Classes/Aggregate/ContentRenderingAggregate.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Aggregate/ContentRenderingAggregate.php b/Classes/Aggregate/ContentRenderingAggregate.php index 8221ef5..ddc5b20 100644 --- a/Classes/Aggregate/ContentRenderingAggregate.php +++ b/Classes/Aggregate/ContentRenderingAggregate.php @@ -168,7 +168,8 @@ protected function addDataProcessing($table, array $fields) $index = 10; foreach ($fields as $field) { if (empty($GLOBALS['TCA'][$table]['columns'][$field]['config']['type']) - || 'inline' !== $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] + || ('inline' !== $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] + && 'file' !== $GLOBALS['TCA'][$table]['columns'][$field]['config']['type']) || empty($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table']) ) { continue; From 14de9313ffe554dc58d2d12082574bde7aedf646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Mon, 16 Oct 2023 11:01:30 +0200 Subject: [PATCH 14/15] Add friendsoftypo3/fontawesome-provider as dependency list EXT:mask does it --- Classes/Aggregate/ExtensionConfigurationAggregate.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/Aggregate/ExtensionConfigurationAggregate.php b/Classes/Aggregate/ExtensionConfigurationAggregate.php index 7e91ae8..5c34e13 100644 --- a/Classes/Aggregate/ExtensionConfigurationAggregate.php +++ b/Classes/Aggregate/ExtensionConfigurationAggregate.php @@ -107,6 +107,7 @@ protected function addComposerJson() 'typo3/cms-extbase' => '^' . $this->typo3Version->getBranch(), 'typo3/cms-fluid' => '^' . $this->typo3Version->getBranch(), 'typo3/cms-frontend' => '^' . $this->typo3Version->getBranch(), + 'friendsoftypo3/fontawesome-provider' => '^1.0', ], 'replace' => [ 'typo3-ter/mask' => 'self.version', From dffb5172268ac3a45f95c0507bfe6d5c5ad4d958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20Ko=CC=88hnlein?= Date: Mon, 16 Oct 2023 11:07:37 +0200 Subject: [PATCH 15/15] Use new class name for FontawesomeIconProvider --- Classes/Aggregate/ContentElementIconAggregate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Aggregate/ContentElementIconAggregate.php b/Classes/Aggregate/ContentElementIconAggregate.php index a4cd594..7baffc1 100644 --- a/Classes/Aggregate/ContentElementIconAggregate.php +++ b/Classes/Aggregate/ContentElementIconAggregate.php @@ -86,7 +86,7 @@ protected function process() <<registerIcon( '$iconIdentifier', - \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class, + \FriendsOfTYPO3\FontawesomeProvider\Imaging\IconProvider\FontawesomeIconProvider::class, [ 'name' => '$iconName', ]