From 058a2a5de786043cc902d343556be2becb05456e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 24 Jul 2025 13:47:32 +0200 Subject: [PATCH 001/111] Update composer dependencies for typo3 v13 support. --- composer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 502d9f22a7..b8d07b1200 100644 --- a/composer.json +++ b/composer.json @@ -32,25 +32,25 @@ "ext-libxml": "*", "ext-openssl": "*", "ext-simplexml": "*", - "typo3/cms-core": "^11.5|^12.4", - "typo3/cms-extbase": "^11.5|^12.4", - "typo3/cms-scheduler": "^11.5|^12.4", - "typo3/cms-tstemplate": "^11.5|^12.4", + "typo3/cms-core": "^12.4|^13.4", + "typo3/cms-extbase": "^12.4|^13.4", + "typo3/cms-scheduler": "^12.4|^13.4", + "typo3/cms-tstemplate": "^12.4|^13.4", "caseyamcl/phpoaipmh": "^3.3", "slub/php-mods-reader": "^0.4", "ubl/php-iiif-prezi-reader": "0.3", "solarium/solarium": "^6.3", "softcreatr/jsonpath": "^0.10", - "symfony/process": "^6.4" + "symfony/process": "^7.3" }, "require-dev": { "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^9.6", "spatie/phpunit-watcher": "^1.23", - "typo3/cms-backend": "^11.5|^12.4", - "typo3/cms-fluid": "^11.5|^12.4", - "typo3/cms-fluid-styled-content": "^11.5|^12.4", - "typo3/cms-frontend": "^11.5|^12.4", + "typo3/cms-backend": "^12.4|^13.4", + "typo3/cms-fluid": "^12.4|^13.4", + "typo3/cms-fluid-styled-content": "^12.4|^13.4", + "typo3/cms-frontend": "^12.4|^13.4", "typo3/testing-framework": "^7.1", "vlucas/phpdotenv": "^5.6" }, From 38d7c111fa603341b9de3c1e3b3604fe8fbbaaf8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 24 Jul 2025 13:48:16 +0200 Subject: [PATCH 002/111] Delete ext_tables.php which is not supported in v12+ any longer. --- ext_tables.php | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 ext_tables.php diff --git a/ext_tables.php b/ext_tables.php deleted file mode 100644 index 8a6c8d3062..0000000000 --- a/ext_tables.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * This file is part of the Kitodo and TYPO3 projects. - * - * @license GNU General Public License version 3 or later. - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - */ - -if (!defined('TYPO3')) { - die('Access denied.'); -} - -// Register backend module for Typo3 v11. - -\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( - 'Dlf', - 'tools', // Main area - 'newTenantModule', // Name of the module - 'bottom', // Position of the module - [// Allowed controller action combinations - \Kitodo\Dlf\Controller\Backend\NewTenantController::class => 'index,error,addFormat,addMetadata,addSolrCore,addStructure', - ], - [// Additional configuration - 'access' => 'admin', - 'icon' => 'EXT:dlf/Resources/Public/Icons/Extension.svg', - 'labels' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_mod_newtenant.xlf', - 'navigationComponentId' => 'TYPO3/CMS/Backend/PageTree/PageTreeElement' - ], -); From fa094bd87d76fd38364f33e6df1171273347cbb0 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 24 Jul 2025 13:48:50 +0200 Subject: [PATCH 003/111] Update TCA file field definitions for typ3 v13 support. --- Configuration/TCA/tx_dlf_collections.php | 22 ++++++++++------------ Configuration/TCA/tx_dlf_libraries.php | 6 ++++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Configuration/TCA/tx_dlf_collections.php b/Configuration/TCA/tx_dlf_collections.php index 415870ac3c..d4209a6622 100644 --- a/Configuration/TCA/tx_dlf_collections.php +++ b/Configuration/TCA/tx_dlf_collections.php @@ -162,19 +162,17 @@ 'exclude' => 1, 'l10n_mode' => 'exclude', 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.thumbnail', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( - 'image', - [ - 'appearance' => [ - 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' - ], - 'foreign_match_fields' => [ - 'fieldname' => 'thumbnail', - 'tablenames' => 'tx_dlf_collections', - ], + 'config' => [ + 'type' => 'file', + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' ], - $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] - ) + 'foreign_match_fields' => [ + 'fieldname' => 'thumbnail', + 'tablenames' => 'tx_dlf_collections', + ], + 'allowed' => 'common-image-types' + ], ], 'priority' => [ 'exclude' => 1, diff --git a/Configuration/TCA/tx_dlf_libraries.php b/Configuration/TCA/tx_dlf_libraries.php index 93507d960c..a5a50a40a9 100644 --- a/Configuration/TCA/tx_dlf_libraries.php +++ b/Configuration/TCA/tx_dlf_libraries.php @@ -109,11 +109,13 @@ 'exclude' => 1, 'l10n_mode' => 'exclude', 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_libraries.image', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', [ + 'config' => [ + 'type' => 'file', 'appearance' => [ 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' ], - ], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']), + 'allowed' => 'common-image-types' + ], ], 'oai_label' => [ 'exclude' => 1, From 48947aa91a36d25b08777be52bc62ae80b92c161 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 24 Jul 2025 13:50:02 +0200 Subject: [PATCH 004/111] Fix fatal php typing errors in typo3 v13. --- Classes/Common/Solr/SolrSearch.php | 8 +++++++- Classes/Common/Solr/SolrSearchQuery.php | 2 +- Classes/Controller/OaiPmhController.php | 2 +- Classes/Domain/Model/SolrCore.php | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Classes/Common/Solr/SolrSearch.php b/Classes/Common/Solr/SolrSearch.php index 8066582504..61e044b587 100644 --- a/Classes/Common/Solr/SolrSearch.php +++ b/Classes/Common/Solr/SolrSearch.php @@ -99,7 +99,13 @@ class SolrSearch implements \Countable, \Iterator, \ArrayAccess, QueryResultInte * * @return void */ - public function __construct(DocumentRepository $documentRepository, $collections, array $settings, array $searchParams, ?QueryResult $listedMetadata = null, ?QueryResult $indexedMetadata = null) + public function __construct( + DocumentRepository $documentRepository, + array|QueryResultInterface $collections, + array $settings = [], + array $searchParams = [], + ?QueryResult $listedMetadata = null, + ?QueryResult $indexedMetadata = null) { $this->documentRepository = $documentRepository; $this->collections = $collections; diff --git a/Classes/Common/Solr/SolrSearchQuery.php b/Classes/Common/Solr/SolrSearchQuery.php index f1da660785..e548df541e 100644 --- a/Classes/Common/Solr/SolrSearchQuery.php +++ b/Classes/Common/Solr/SolrSearchQuery.php @@ -33,7 +33,7 @@ class SolrSearchQuery extends Query * * @return void */ - public function __construct($solrSearch) + public function __construct(SolrSearch $solrSearch) { $this->solrSearch = $solrSearch; diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index ddfc5e5949..3af6283282 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -91,7 +91,7 @@ public function injectLibraryRepository(LibraryRepository $libraryRepository) * * @return void */ - public function initializeAction() + public function initializeAction(): void { $this->request = $this->request->withFormat("xml"); } diff --git a/Classes/Domain/Model/SolrCore.php b/Classes/Domain/Model/SolrCore.php index ced90803f3..ca833cce7b 100644 --- a/Classes/Domain/Model/SolrCore.php +++ b/Classes/Domain/Model/SolrCore.php @@ -28,9 +28,9 @@ class SolrCore extends AbstractEntity { /** * @access protected - * @var int + * @var ?int */ - protected $pid; + protected ?int $pid; /** * @access protected From add58f2e6677f1af16d2a860ac0077555ecdbf12 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 11:54:48 +0200 Subject: [PATCH 005/111] Remove variable definition in SolrCore.php which is inherited but differs between v12 and v13. --- Classes/Domain/Model/SolrCore.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Classes/Domain/Model/SolrCore.php b/Classes/Domain/Model/SolrCore.php index ca833cce7b..c9ecd0cb10 100644 --- a/Classes/Domain/Model/SolrCore.php +++ b/Classes/Domain/Model/SolrCore.php @@ -26,12 +26,6 @@ */ class SolrCore extends AbstractEntity { - /** - * @access protected - * @var ?int - */ - protected ?int $pid; - /** * @access protected * @var string Label of the core that is displayed in the backend. From 52bb08e4721cc5204a882ee0f07695e78efea710 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 11:56:08 +0200 Subject: [PATCH 006/111] Fix template rendering in NewTenantController compatible to v12 and v13. --- Classes/Controller/AbstractController.php | 2 +- .../Backend/NewTenantController.php | 21 +-- .../Templates/Backend/NewTenant/Index.html | 129 +++++++++--------- 3 files changed, 79 insertions(+), 73 deletions(-) diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index d304a1fbd0..9b4c41e77a 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -121,7 +121,7 @@ protected function initialize(RequestInterface $request): void { /** @var Request $request */ $this->requestData = $request->getQueryParams()['tx_dlf'] ?? []; - $this->pageUid = (int) GeneralUtility::_GET('id'); + $this->pageUid = (int) $request->getQueryParams()['id'] ?? null; $this->requestData['page'] = $this->requestData['page'] ?? 1; // Sanitize user input to prevent XSS attacks. diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index 96e4f53b52..a5bd8dab84 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -148,20 +148,24 @@ public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) * * @access protected * - * @param ?string $html optional html + * @param bool $isError whether to render the non-error or error template + * + * @param array $extra extra view data used to render the template (in addition to $viewData of AbstractController) * * @return ResponseInterface the response */ - protected function htmlResponse(?string $html = null): ResponseInterface + protected function templateResponse(bool $isError, array $extraData): ResponseInterface { $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); $messageQueue = $flashMessageService->getMessageQueueByIdentifier(); $moduleTemplateFactory = GeneralUtility::makeInstance(ModuleTemplateFactory::class); $moduleTemplate = $moduleTemplateFactory->create($this->request); - $moduleTemplate->setContent($this->view->render()); + $moduleTemplate->assignMultiple($this->viewData); + $moduleTemplate->assignMultiple($extraData); $moduleTemplate->setFlashMessageQueue($messageQueue); - return parent::htmlResponse(($html ?? $moduleTemplate->renderContent())); + $template = $isError ? 'Backend/NewTenant/Error' : 'Backend/NewTenant/Index'; + return $moduleTemplate->renderResponse($template); } /** @@ -173,8 +177,7 @@ protected function htmlResponse(?string $html = null): ResponseInterface */ protected function initializeAction(): void { - // replace with $this->request->getQueryParams() when dropping support for Typo3 v11, see Deprecation-100596 - $this->pid = (int) GeneralUtility::_GP('id'); + $this->pid = (int) $this->request->getQueryParams()['id'] ?? null; $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); $frameworkConfiguration['persistence']['storagePid'] = $this->pid; @@ -437,9 +440,9 @@ public function indexAction(): ResponseInterface $recordInfos['solrcore']['numCurrent'] = $this->solrCoreRepository->countByPid($this->pid); - $this->view->assign('recordInfos', $recordInfos); + $viewData = ['recordInfos' => $recordInfos]; - return $this->htmlResponse(); + return $this->templateResponse(false, $viewData); } /** @@ -452,7 +455,7 @@ public function indexAction(): ResponseInterface // @phpstan-ignore-next-line public function errorAction(): ResponseInterface { - return $this->htmlResponse(); + return $this->templateResponse(true, []); } /** diff --git a/Resources/Private/Templates/Backend/NewTenant/Index.html b/Resources/Private/Templates/Backend/NewTenant/Index.html index 9a838447c9..403c32506c 100644 --- a/Resources/Private/Templates/Backend/NewTenant/Index.html +++ b/Resources/Private/Templates/Backend/NewTenant/Index.html @@ -12,80 +12,83 @@ - -

+
+

-
+
- - - - - - - - - - - - - + + + + + + + + + + + + + -
+
-
+
- - - - - - - - - - - + + + + + + + + + + + -
+
-
- - - - - - - - - - - - - - - - - - -
+
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
-
- - - - - - - - - - -
From 0be9bf9b5701672f7e819ee8ac70a56ad443deec Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 18:53:50 +0200 Subject: [PATCH 007/111] Workaround for retrieving storagePid in ItemsProcFunc.php. --- Classes/Common/TypoScriptHelper.php | 129 ++++++++++++++++++++++++++++ Classes/Hooks/ItemsProcFunc.php | 32 ++----- Configuration/Services.yaml | 3 + 3 files changed, 139 insertions(+), 25 deletions(-) create mode 100644 Classes/Common/TypoScriptHelper.php diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php new file mode 100644 index 0000000000..0917c7c06b --- /dev/null +++ b/Classes/Common/TypoScriptHelper.php @@ -0,0 +1,129 @@ + + * + * This file is part of the Kitodo and TYPO3 projects. + * + * @license GNU General Public License version 3 or later. + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + */ + +namespace Kitodo\Dlf\Common; + +use Symfony\Component\DependencyInjection\Attribute\Autowire; +use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; +use TYPO3\CMS\Core\Context\Context; +use TYPO3\CMS\Core\Http\ServerRequest; +use TYPO3\CMS\Core\Information\Typo3Version; +use TYPO3\CMS\Core\Routing\PageArguments; +use TYPO3\CMS\Core\Site\SiteFinder; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory; +use TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateRepository; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\RootlineUtility; +use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; +use TYPO3\CMS\Frontend\Page\PageInformation; +use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; + +/** + * Helper class that allows to access TypoScript from backend. + */ +class TypoScriptHelper +{ + public function __construct( + private readonly FrontendTypoScriptFactory $frontendTypoScriptFactory, + private readonly SysTemplateRepository $sysTemplateRepository, + ) {} + + /** + * Extract typoScript configuration from site root for Typo3 v13 + * + * @access public + * + * @param int $pid + * + * @return array + */ + public function getTyposcriptConfigV13(int $pid): array + { + $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); + $site = $siteFinder->getSiteByPageId($pid); + + $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pid)->get(); + $sysTemplateRows = $this->sysTemplateRepository->getSysTemplateRowsByRootline($rootLine); + + $frontendTypoScript = $this->frontendTypoScriptFactory->createSettingsAndSetupConditions( + $site, + $sysTemplateRows, + [], + null, + ); + + $ts = $this->frontendTypoScriptFactory->createSetupConfigOrFullSetup( + true, + $frontendTypoScript, + $site, + $sysTemplateRows, + [], + '0', + null, + null, + ); + + return $ts->getSetupArray(); + } + + /** + * Extract typoScript configuration from site root for Typo3 v12 + * + * @access public + * + * @param int $pid page id + * + * @return array typoscript configuration of site root + */ + public static function getTyposcriptConfigV12(int $pid): array + { + $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); + $site = $siteFinder->getSiteByPageId($pid); + $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pid)->get(); + + $typoScriptFrontendController = GeneralUtility::makeInstance( + TypoScriptFrontendController::class, + GeneralUtility::makeInstance(Context::class), + $site, + $site->getDefaultLanguage(), + GeneralUtility::makeInstance(PageArguments::class, $pid, '', []), + GeneralUtility::makeInstance(FrontendUserAuthentication::class), + ); + + $typoScriptFrontendController->rootLine = $rootLine; + $request = new ServerRequest(); + $request = $typoScriptFrontendController->getFromCache($request); + + return $request->getAttribute('frontend.typoscript')->getSetupArray(); + } + + /** + * Get TypoScript configuration from site root + * + * Note: When upgrading Typo3, maybe use site settings to store storagePid, see: + * https://docs.typo3.org/permalink/t3coreapi:sitehandling-settings + * + * @access public + * + * @param int $pid page id + * + * @return array typoscript configuration of site root + */ + public static function getTyposcriptConfig(int $pid): array + { + $typo3Version = (new Typo3Version())->getMajorVersion(); + if ($typo3Version === 13) { + return GeneralUtility::makeInstance(TypoScriptHelper::class)->getTyposcriptConfigV13($pid); + } + return TypoScriptHelper::getTyposcriptConfigV12($pid); + } +} \ No newline at end of file diff --git a/Classes/Hooks/ItemsProcFunc.php b/Classes/Hooks/ItemsProcFunc.php index 58371b1d27..5333a33a4c 100644 --- a/Classes/Hooks/ItemsProcFunc.php +++ b/Classes/Hooks/ItemsProcFunc.php @@ -13,12 +13,11 @@ namespace Kitodo\Dlf\Hooks; use Kitodo\Dlf\Common\Helper; +use Kitodo\Dlf\Common\TypoScriptHelper; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; -use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Configuration\ConfigurationManager; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -58,7 +57,7 @@ public function toolList(array &$params): void } /** - * Extract typoScript configuration from site root of the plugin + * Extract typoScript configuration from site root to load storagePid * * @access public * @@ -66,28 +65,11 @@ public function toolList(array &$params): void * * @return void */ - public function getTyposcriptConfigFromPluginSiteRoot(array $params): void + public function loadStoragePid(array $params): void { $pid = $params['flexParentDatabaseRow']['pid']; - $rootLine = BackendUtility::BEgetRootLine($pid); - $siteRootRow = []; - foreach ($rootLine as $row) { - if (isset($row['is_siteroot'])) { - $siteRootRow = $row; - break; - } - } - - try { - $ts = GeneralUtility::makeInstance(TemplateService::class); - $ts->rootLine = $rootLine; - $ts->runThroughTemplates($rootLine, 0); - $ts->generateConfig(); - $typoScriptConfig = $ts->setup; - $this->storagePid = $typoScriptConfig['plugin.']['tx_dlf.']['persistence.']['storagePid']; - } catch (\Exception $e) { - $this->logger->error($e->getMessage()); - } + $config = TypoScriptHelper::getTyposcriptConfig($pid); + $this->storagePid = $config['plugin.']['tx_dlf.']['persistence.']['storagePid']; } /** @@ -143,7 +125,7 @@ public function getFacetsList(array &$params): void */ protected function generateList(array &$params, string $fields, string $table, string $sorting, string $andWhere = ''): void { - $this->getTyposcriptConfigFromPluginSiteRoot($params); + $this->loadStoragePid($params); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($table); @@ -158,7 +140,7 @@ protected function generateList(array &$params, string $fields, string $table, s $andWhere ) ->orderBy($sorting) - ->execute(); + ->executeQuery(); while ($resArray = $result->fetchNumeric()) { $params['items'][] = $resArray; diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index d9bcc950a2..1644c6046c 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -42,6 +42,9 @@ services: - name: console.command command: 'kitodo:suggestBuild' + Kitodo\Dlf\Common\TypoScriptHelper: + public: true + Kitodo\Dlf\Validation\DOMDocumentValidationStack: autowire: false From 63c46022af2a0cac49f27db32253213da1100eb2 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 19:17:59 +0200 Subject: [PATCH 008/111] Remove TCEforms wrapper in FlexForm xml files for Typo3 v13 support. --- Configuration/FlexForms/AudioPlayer.xml | 34 +- Configuration/FlexForms/Basket.xml | 144 +++--- Configuration/FlexForms/Calendar.xml | 84 ++-- Configuration/FlexForms/Collection.xml | 216 ++++----- Configuration/FlexForms/Embedded3dViewer.xml | 46 +- Configuration/FlexForms/Feeds.xml | 168 +++---- Configuration/FlexForms/ListView.xml | 132 +++--- Configuration/FlexForms/MediaPlayer.xml | 174 +++---- Configuration/FlexForms/Metadata.xml | 244 +++++----- Configuration/FlexForms/Navigation.xml | 198 ++++---- Configuration/FlexForms/OaiPmh.xml | 244 +++++----- Configuration/FlexForms/PageGrid.xml | 190 ++++---- Configuration/FlexForms/PageView.xml | 206 ++++---- Configuration/FlexForms/Search.xml | 466 +++++++++---------- Configuration/FlexForms/Statistics.xml | 54 +-- Configuration/FlexForms/TableOfContents.xml | 114 ++--- Configuration/FlexForms/Toolbox.xml | 56 +-- Configuration/FlexForms/ValidationForm.xml | 20 +- 18 files changed, 1266 insertions(+), 1524 deletions(-) diff --git a/Configuration/FlexForms/AudioPlayer.xml b/Configuration/FlexForms/AudioPlayer.xml index 3ba57921f2..2204acee27 100644 --- a/Configuration/FlexForms/AudioPlayer.xml +++ b/Configuration/FlexForms/AudioPlayer.xml @@ -15,31 +15,25 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - input - required,alphanum_x,nospace - tx-dlf-audio - - + 1 + + + input + required,alphanum_x,nospace + tx-dlf-audio + diff --git a/Configuration/FlexForms/Basket.xml b/Configuration/FlexForms/Basket.xml index 348d6205c3..462ced97ec 100644 --- a/Configuration/FlexForms/Basket.xml +++ b/Configuration/FlexForms/Basket.xml @@ -15,104 +15,86 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - input - required - - + 1 + + + input + required + - - 1 - - - input - required - - - + 1 + + + input + required + + - - 1 - - - input - required - - - + 1 + + + input + required + + - - 1 - - - input - required - ##docId##,##startpage##,##endpage##,##startx##,##starty##,##endx##,##endy##,##rotation## - - + 1 + + + input + required + ##docId##,##startpage##,##endpage##,##startx##,##starty##,##endx##,##endy##,##rotation## + - - 1 - - - input - required - * - - + 1 + + + input + required + * + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - group - db - pages - 1 - 1 - 1 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 1 + 1 + + + suggest + + + diff --git a/Configuration/FlexForms/Calendar.xml b/Configuration/FlexForms/Calendar.xml index a73bfde134..8efca97b4a 100644 --- a/Configuration/FlexForms/Calendar.xml +++ b/Configuration/FlexForms/Calendar.xml @@ -15,70 +15,60 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - - 1 - - - group - db - tx_dlf_documents - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + db + tx_dlf_documents + 1 + 1 + 0 + 1 + + + suggest + + + - 1 - check - 0 + check + 0 - - 1 - check - 1 + check + 1 - diff --git a/Configuration/FlexForms/Collection.xml b/Configuration/FlexForms/Collection.xml index a6d4fc2aac..a9188f4c4e 100644 --- a/Configuration/FlexForms/Collection.xml +++ b/Configuration/FlexForms/Collection.xml @@ -15,140 +15,122 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectMultipleSideBySide - tx_dlf_collections - AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_collections.label ASC - - 5 - 15 - 1024 - 0 - - + 1 + + + select + selectMultipleSideBySide + tx_dlf_collections + AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_collections.label ASC + + 5 + 15 + 1024 + 0 + - - 1 - - - select - selectSingle - tx_dlf_solrcores - ORDER BY - tx_dlf_solrcores.label ASC - - 1 - 1 - 1 - - + 1 + + + select + selectSingle + tx_dlf_solrcores + ORDER BY + tx_dlf_solrcores.label ASC + + 1 + 1 + 1 + - - 1 - - - select - selectSingle - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.collection.flexform.show_userdefined.all - -1 - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.collection.flexform.show_userdefined.none - 0 - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.collection.flexform.show_userdefined.exclusive - 1 - - - 1 - 1 - 0 - - + 1 + + + select + selectSingle + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.collection.flexform.show_userdefined.all + -1 + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.collection.flexform.show_userdefined.none + 0 + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.collection.flexform.show_userdefined.exclusive + 1 + + + 1 + 1 + 0 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - - 1 - - - group - db - pages - 1 - 1 - 0 - - + 1 + + + group + db + pages + 1 + 1 + 0 + - - 1 - - - group - db - pages - 1 - 1 - 0 - - + 1 + + + group + db + pages + 1 + 1 + 0 + diff --git a/Configuration/FlexForms/Embedded3dViewer.xml b/Configuration/FlexForms/Embedded3dViewer.xml index 8838e5b51f..2eab4bffd5 100644 --- a/Configuration/FlexForms/Embedded3dViewer.xml +++ b/Configuration/FlexForms/Embedded3dViewer.xml @@ -15,40 +15,32 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - input - trim - - + 1 + + + input + trim + - - 1 - - - input - trim - - + 1 + + + input + trim + - - 1 - - - input - trim - - + 1 + + + input + trim + diff --git a/Configuration/FlexForms/Feeds.xml b/Configuration/FlexForms/Feeds.xml index c533204a45..292dacecaa 100644 --- a/Configuration/FlexForms/Feeds.xml +++ b/Configuration/FlexForms/Feeds.xml @@ -15,116 +15,98 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectMultipleSideBySide - tx_dlf_collections - AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_collections.label ASC - - 5 - 15 - 1024 - 0 - - + 1 + + + select + selectMultipleSideBySide + tx_dlf_collections + AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_collections.label ASC + + 5 + 15 + 1024 + 0 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - select - selectSingle - tx_dlf_libraries - AND tx_dlf_libraries.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_libraries.label ASC - - 1 - 1 - 0 - - + 1 + + + select + selectSingle + tx_dlf_libraries + AND tx_dlf_libraries.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_libraries.label ASC + + 1 + 1 + 0 + - - 1 - - - input - required,num,int - 50 - - + 1 + + + input + required,num,int + 50 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - group - db - pages - 1 - 1 - 1 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 1 + 1 + + + suggest + + + - - 1 - - - input - required,trim - - + 1 + + + input + required,trim + - - 1 - - - input - trim - - + 1 + + + input + trim + diff --git a/Configuration/FlexForms/ListView.xml b/Configuration/FlexForms/ListView.xml index 69439b9c5c..ca0bbdbe70 100644 --- a/Configuration/FlexForms/ListView.xml +++ b/Configuration/FlexForms/ListView.xml @@ -15,92 +15,78 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectSingle - tx_dlf_solrcores - ORDER BY tx_dlf_solrcores.label ASC - 1 - 1 - 0 - - + 1 + + + select + selectSingle + tx_dlf_solrcores + ORDER BY tx_dlf_solrcores.label ASC + 1 + 1 + 0 + - - 1 - - - input - required,num,int - 25 - - + 1 + + + input + required,num,int + 25 + - - 1 - - - group - db - pages - 1 - 1 - 1 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 1 + 1 + + + suggest + + + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - reload - 1 - - - check - 0 - - + reload + 1 + + + check + 0 + - - FIELD:settings.basketButton:REQ:true - 1 - - - group - db - pages - 1 - 1 - 1 - - + FIELD:settings.basketButton:REQ:true + 1 + + + group + db + pages + 1 + 1 + 1 + diff --git a/Configuration/FlexForms/MediaPlayer.xml b/Configuration/FlexForms/MediaPlayer.xml index 10e1646bcc..f280fb9e6b 100644 --- a/Configuration/FlexForms/MediaPlayer.xml +++ b/Configuration/FlexForms/MediaPlayer.xml @@ -15,31 +15,25 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - input - required,alphanum_x,nospace - tx-dlf-video - - + 1 + + + input + required,alphanum_x,nospace + tx-dlf-video + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.title @@ -51,99 +45,85 @@ array - - - reload - - select - selectSingle - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.type.material - material - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.type.image - image - - - - + + reload + + select + selectSingle + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.type.material + material + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.type.image + image + + + - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.icon.description - - FIELD:type:=:material - - - input - 255 - trim - - + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.icon.description + + FIELD:type:=:material + + + input + 255 + trim + - - - - FIELD:type:=:image - - - input - 255 - trim - - + + + FIELD:type:=:image + + + input + 255 + trim + - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.titleTranslationKey.description - - input - 255 - trim - - + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.titleTranslationKey.description + + input + 255 + trim + - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.hrefTemplate.description - - input - 255 - trim - - + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.shareButtons.hrefTemplate.description + + input + 255 + trim + - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.constants.prevChapterTolerance.description - - input - required,num,int - 5 - 0 - - + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.mediaplayer.flexform.constants.prevChapterTolerance.description + + input + required,num,int + 5 + 0 + diff --git a/Configuration/FlexForms/Metadata.xml b/Configuration/FlexForms/Metadata.xml index 34b9f1a1c5..11a6bc6b9a 100644 --- a/Configuration/FlexForms/Metadata.xml +++ b/Configuration/FlexForms/Metadata.xml @@ -15,166 +15,140 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - reload - 1 - - - check - 1 - - + reload + 1 + + + check + 1 + - - FIELD:settings.linkTitle:REQ:true - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + FIELD:settings.linkTitle:REQ:true + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - select - selectSingle - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.none - 0 - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.all - 1 - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.metadata.flexform.rootline.titledata - 2 - - - 1 - 1 - 1 - 0 - - + 1 + + + select + selectSingle + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.none + 0 + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.all + 1 + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.metadata.flexform.rootline.titledata + 2 + + + 1 + 1 + 1 + 0 + - - 1 - - reload - - check - 0 - - + 1 + + reload + + check + 0 + - - 1 - - FIELD:settings.originalIiifMetadata:=:1 - - text - key.wrap = <dt>|</dt> value.required = 1 value.wrap = <dd>|</dd> - - + 1 + + FIELD:settings.originalIiifMetadata:=:1 + + text + key.wrap = <dt>|</dt> value.required = 1 value.wrap = <dd>|</dd> + - - 1 - - FIELD:settings.originalIiifMetadata:=:1 - - check - 1 - - + 1 + + FIELD:settings.originalIiifMetadata:=:1 + + check + 1 + - - 1 - - FIELD:settings.originalIiifMetadata:=:1 - - check - 1 - - + 1 + + FIELD:settings.originalIiifMetadata:=:1 + + check + 1 + - - 1 - - FIELD:settings.originalIiifMetadata:=:1 - - check - 1 - - + 1 + + FIELD:settings.originalIiifMetadata:=:1 + + check + 1 + - - 1 - - - input - required,trim - # - - + 1 + + + input + required,trim + # + diff --git a/Configuration/FlexForms/Navigation.xml b/Configuration/FlexForms/Navigation.xml index 72142da70b..a76609fe82 100644 --- a/Configuration/FlexForms/Navigation.xml +++ b/Configuration/FlexForms/Navigation.xml @@ -15,116 +15,108 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectMultipleSideBySide - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.doublePage - doublePage - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageFirst - pageFirst - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageBack - pageBack - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageStepBack - pageStepBack - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageSelect - pageSelect - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageForward - pageForward - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageStepForward - pageStepForward - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageLast - pageLast - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.listView - listView - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.zoom - zoom - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.rotation - rotation - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.measureForward - measureForward - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.measureBack - measureBack - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.documentBack - documentBack - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.documentForward - documentForward - - - doublePage,pageFirst,pageBack,pageStepBack,pageSelect,pageForward,pageStepForward,pageLast,listView,zoom,rotation,measureForward,measureBack,documentBack,documentForward - 1 - - + 1 + + + select + selectMultipleSideBySide + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.doublePage + doublePage + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageFirst + pageFirst + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageBack + pageBack + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageStepBack + pageStepBack + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageSelect + pageSelect + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageForward + pageForward + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageStepForward + pageStepForward + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.pageLast + pageLast + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.listView + listView + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.zoom + zoom + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.rotation + rotation + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.measureForward + measureForward + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.measureBack + measureBack + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.documentBack + documentBack + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.navigation.flexform.features.documentForward + documentForward + + + doublePage,pageFirst,pageBack,pageStepBack,pageSelect,pageForward,pageStepForward,pageLast,listView,zoom,rotation,measureForward,measureBack,documentBack,documentForward + 1 + - - 1 - - - input - required,num,int - 5 - - + 1 + + + input + required,num,int + 5 + - - 1 - FIELD:settings.features:IN:listView - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + FIELD:settings.features:IN:listView + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + diff --git a/Configuration/FlexForms/OaiPmh.xml b/Configuration/FlexForms/OaiPmh.xml index 8de01739e9..bb621b0ae3 100644 --- a/Configuration/FlexForms/OaiPmh.xml +++ b/Configuration/FlexForms/OaiPmh.xml @@ -15,154 +15,138 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectSingle - tx_dlf_libraries - AND tx_dlf_libraries.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_libraries.label ASC - - 1 - 1 - 0 - - + 1 + + + select + selectSingle + tx_dlf_libraries + AND tx_dlf_libraries.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_libraries.label ASC + + 1 + 1 + 0 + - - 1 - - - input - required,num,int - 5 - - + 1 + + + input + required,num,int + 5 + - - 1 - - - input - required,num,int - 1800 - - + 1 + + + input + required,num,int + 1800 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - select - selectSingle - tx_dlf_solrcores - ORDER BY tx_dlf_solrcores.label ASC - 1 - 1 - 0 - - + 1 + + + select + selectSingle + tx_dlf_solrcores + ORDER BY tx_dlf_solrcores.label ASC + 1 + 1 + 0 + - - 1 - - - input - required,num,int - 50000 - - + 1 + + + input + required,num,int + 50000 + - - 1 - - - inline - 1 - sys_file_reference - tablenames - uid_local - sorting_foreign - uid_foreign - uid_local - - - - file - xsl,xslt - - - - - - --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette - + 1 + + + inline + 1 + sys_file_reference + tablenames + uid_local + sorting_foreign + uid_foreign + uid_local + + + + file + xsl,xslt + + + + + + --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + + stylesheet + + + 1 + + 1 + 0 + 0 + 1 + 0 + 1 + 1 + + LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:media.addFileReference + + + select + 1 + + + + + + + file + xsl,xslt + + + + + --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette - - - stylesheet - - - 1 - - 1 - 0 - 0 - 1 - 0 - 1 - 1 - - LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:media.addFileReference - - - select - 1 - - - - - - - file - xsl,xslt - - - - - - - --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette - - - - - + + + diff --git a/Configuration/FlexForms/PageGrid.xml b/Configuration/FlexForms/PageGrid.xml index a4540ee96c..9900eee3bc 100644 --- a/Configuration/FlexForms/PageGrid.xml +++ b/Configuration/FlexForms/PageGrid.xml @@ -15,115 +15,107 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - input - required,num,int - 24 - - + 1 + + + input + required,num,int + 24 + - - 1 - - - inline - 1 - sys_file_reference - tablenames - uid_local - sorting_foreign - uid_foreign - uid_local - - - - file - gif,jpg,jpeg,png - - - - - - --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette - + 1 + + + inline + 1 + sys_file_reference + tablenames + uid_local + sorting_foreign + uid_foreign + uid_local + + + + file + gif,jpg,jpeg,png + + + + + + --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + + image + + + 1 + + uid_local + 64 + 64 + + + 1 + 0 + 0 + 1 + 0 + 1 + 1 + + LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference + + + select + 1 + + + + + + + file + jpg,png,jpeg,gif + + + + + --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette - - - image - - - 1 - - uid_local - 64 - 64 - - - 1 - 0 - 0 - 1 - 0 - 1 - 1 - - LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference - - - select - 1 - - - - - - - file - jpg,png,jpeg,gif - - - - - - - --palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette - - - - - + + + - - 1 - - - group - db - pages - 1 - 1 - 1 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 1 + 1 + + + suggest + + + diff --git a/Configuration/FlexForms/PageView.xml b/Configuration/FlexForms/PageView.xml index 67cf8d7698..753059e659 100644 --- a/Configuration/FlexForms/PageView.xml +++ b/Configuration/FlexForms/PageView.xml @@ -15,141 +15,119 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - select - selectMultipleSideBySide - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.pageview.flexform.features.overviewmap - OverviewMap - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.pageview.flexform.features.zoompanel - ZoomPanel - - - 5 - 15 - 25 - 0 - - + 1 + + + select + selectMultipleSideBySide + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.pageview.flexform.features.overviewmap + OverviewMap + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.pageview.flexform.features.zoompanel + ZoomPanel + + + 5 + 15 + 25 + 0 + - - 1 - - - input - required,alphanum_x,nospace - tx-dlf-map - - + 1 + + + input + required,alphanum_x,nospace + tx-dlf-map + - - 1 - - - input - required,alphanum_x,nospace - tx-dlf-page-progress - - + 1 + + + input + required,alphanum_x,nospace + tx-dlf-page-progress + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - reload - - check - 0 - - + 1 + + reload + + check + 0 + - - 1 - - FIELD:settings.basketButton:REQ:TRUE - - check - 0 - - + 1 + + FIELD:settings.basketButton:REQ:TRUE + + check + 0 + - - 1 - - FIELD:settings.basketButton:REQ:TRUE - - check - 0 - - + 1 + + FIELD:settings.basketButton:REQ:TRUE + + check + 0 + - - 1 - - FIELD:settings.basketButton:REQ:TRUE - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + FIELD:settings.basketButton:REQ:TRUE + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - - 1 - - - input - nospace - - - + 1 + + + input + nospace + + diff --git a/Configuration/FlexForms/Search.xml b/Configuration/FlexForms/Search.xml index e85f1cd055..7c142be394 100644 --- a/Configuration/FlexForms/Search.xml +++ b/Configuration/FlexForms/Search.xml @@ -15,295 +15,257 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - radio - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.yes - 1 - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.no - 0 - - - 1 - 1 - - + 1 + + + radio + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.yes + 1 + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.no + 0 + + + 1 + 1 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - select - selectSingle - tx_dlf_solrcores - ORDER BY tx_dlf_solrcores.label ASC - 1 - 1 - 0 - - + 1 + + + select + selectSingle + tx_dlf_solrcores + ORDER BY tx_dlf_solrcores.label ASC + 1 + 1 + 0 + - - 1 - - - input - num,int - - 0 - 10 - - 0 - - + 1 + + + input + num,int + + 0 + 10 + + 0 + - - 1 - - - select - selectMultipleSideBySide - - Kitodo\Dlf\Hooks\ItemsProcFunc->extendedSearchList - 5 - 15 - 10 - 0 - - + 1 + + + select + selectMultipleSideBySide + + Kitodo\Dlf\Hooks\ItemsProcFunc->extendedSearchList + 5 + 15 + 10 + 0 + - - 1 - - - select - selectSingle - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.none - none - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.searchIn.document - document - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.searchIn.collection - collection - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.searchIn.all - all - - - 1 - 1 - 0 - - + 1 + + + select + selectSingle + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:text.none + none + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.searchIn.document + document + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.searchIn.collection + collection + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.searchIn.all + all + + + 1 + 1 + 0 + - - 1 - - - select - selectMultipleSideBySide - tx_dlf_collections - AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_collections.label ASC - - 5 - 15 - Kitodo\Dlf\Hooks\ItemsProcFunc->getFacetsList - - 1024 - 0 - - + 1 + + + select + selectMultipleSideBySide + tx_dlf_collections + AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_collections.label ASC + + 5 + 15 + + Kitodo\Dlf\Hooks\ItemsProcFunc->getFacetsList + 1024 + 0 + - - 1 - - - select - selectMultipleSideBySide - - Kitodo\Dlf\Hooks\ItemsProcFunc->getFacetsList - 5 - 15 - 1024 - 0 - - + 1 + + + select + selectMultipleSideBySide + + Kitodo\Dlf\Hooks\ItemsProcFunc->getFacetsList + 5 + 15 + 1024 + 0 + - - 1 - - - select - selectMultipleSideBySide - tx_dlf_collections - AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_collections.label ASC - - 5 - 15 - 1024 - 0 - - + 1 + + + select + selectMultipleSideBySide + tx_dlf_collections + AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_collections.label ASC + + 5 + 15 + 1024 + 0 + - - 1 - - - input - num,int - - 1 - 50000 - - 15 - - + 1 + + + input + num,int + + 1 + 50000 + + 15 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - select - selectSingle - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.facets.sorting.count - count - - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.facets.sorting.index - index - - - 1 - 1 - 0 - - + 1 + + + select + selectSingle + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.facets.sorting.count + count + + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.flexform.facets.sorting.index + index + + + 1 + 1 + 0 + - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - reload - 1 - - - check - 0 - - + reload + 1 + + + check + 0 + - - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - 0 - 1 - - - group - db - pages - 1 - 1 - 0 - - + 1 + + + group + db + pages + 1 + 1 + 0 + diff --git a/Configuration/FlexForms/Statistics.xml b/Configuration/FlexForms/Statistics.xml index 90d3df5ce8..7dcbfa95e6 100644 --- a/Configuration/FlexForms/Statistics.xml +++ b/Configuration/FlexForms/Statistics.xml @@ -15,41 +15,35 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectMultipleSideBySide - tx_dlf_collections - AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) - ORDER BY tx_dlf_collections.label ASC - - 5 - 15 - 1024 - 0 - - + 1 + + + select + selectMultipleSideBySide + tx_dlf_collections + AND tx_dlf_collections.hidden = 0 AND tx_dlf_collections.sys_language_uid IN (-1,0) + ORDER BY tx_dlf_collections.label ASC + + 5 + 15 + 1024 + 0 + - - 1 - - - text - 30 - 10 - virtual - - richtext[undo,redo,cut,copy,paste,link,image,line,acronym,chMode,blockstylelabel,formatblock,blockstyle,textstylelabel,textstyle,bold,italic,unorderedlist,orderedlist]:rte_transform[mode=ts_css] - + 1 + + + text + 30 + 10 + virtual + + richtext[undo,redo,cut,copy,paste,link,image,line,acronym,chMode,blockstylelabel,formatblock,blockstyle,textstylelabel,textstyle,bold,italic,unorderedlist,orderedlist]:rte_transform[mode=ts_css] diff --git a/Configuration/FlexForms/TableOfContents.xml b/Configuration/FlexForms/TableOfContents.xml index 179b18e0b5..61c7eabbe6 100644 --- a/Configuration/FlexForms/TableOfContents.xml +++ b/Configuration/FlexForms/TableOfContents.xml @@ -15,80 +15,68 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - check - 1 - - + 1 + + + check + 1 + - - 1 - - - check - 0 - - + 1 + + + check + 0 + - - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + db + pages + 1 + 1 + 0 + 1 + + + suggest + + + - - 1 - - - check - 0 - - + 1 + + + check + 0 + diff --git a/Configuration/FlexForms/Toolbox.xml b/Configuration/FlexForms/Toolbox.xml index a11916c73c..e9208ee797 100644 --- a/Configuration/FlexForms/Toolbox.xml +++ b/Configuration/FlexForms/Toolbox.xml @@ -15,42 +15,36 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - - select - selectMultipleSideBySide - - Kitodo\Dlf\Hooks\ItemsProcFunc->toolList - 5 - 15 - 1024 - 1 - 1 - - + 1 + + + select + selectMultipleSideBySide + + Kitodo\Dlf\Hooks\ItemsProcFunc->toolList + 5 + 15 + 1024 + 1 + 1 + - - 1 - - - select - selectSingle - tx_dlf_solrcores - ORDER BY tx_dlf_solrcores.label ASC - 1 - 1 - 0 - - + 1 + + + select + selectSingle + tx_dlf_solrcores + ORDER BY tx_dlf_solrcores.label ASC + 1 + 1 + 0 + diff --git a/Configuration/FlexForms/ValidationForm.xml b/Configuration/FlexForms/ValidationForm.xml index 2411cd021b..e2145c50fa 100644 --- a/Configuration/FlexForms/ValidationForm.xml +++ b/Configuration/FlexForms/ValidationForm.xml @@ -15,21 +15,17 @@ - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general - + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flexform.sheet_general array - - 1 - - LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.validationform.flexform.type.description - - input - required,trim - - + 1 + + LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.validationform.flexform.type.description + + input + required,trim + From fb714ca4703681c7aa58d1a8296d15bb39ccbe84 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 19:22:56 +0200 Subject: [PATCH 009/111] Fix deprecated _GPmerged call in SearchController.php. --- Classes/Controller/SearchController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index b6cd3521f0..e6aa1a94e6 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -121,8 +121,7 @@ public function mainAction(): ResponseInterface $this->search = $this->getParametersSafely('search'); // if search was triggered by the ListView plugin, get the parameters from GET variables - // replace with $this->request->getQueryParams() when dropping support for Typo3 v11, see Deprecation-100596 - $listRequestData = GeneralUtility::_GPmerged('tx_dlf_listview'); + $listRequestData = $this->request->getQueryParams()['tx_dlf_listview'] ?? null; // Quit without doing anything if no search parameters. if (empty($this->search) && empty($listRequestData)) { $this->logger->warning('Missing search parameters'); From de75f4e8165a1546b861352e014497f15fe9a4bc Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 20:12:48 +0200 Subject: [PATCH 010/111] Update QueryBuilder::execute to QueryBuilder::executeQuery for Typo3 v13 update. Fix backend index command. --- Classes/Command/BaseCommand.php | 6 +++++- Classes/Common/AbstractDocument.php | 4 ++-- Classes/Common/Helper.php | 10 +++++----- Classes/Common/IiifManifest.php | 4 ++-- Classes/Common/Indexer.php | 2 +- Classes/Common/MetsDocument.php | 10 +++++----- Classes/Common/Solr/Solr.php | 2 +- .../Repository/CollectionRepository.php | 2 +- .../Domain/Repository/DocumentRepository.php | 20 +++++++++---------- Classes/Hooks/DataHandler.php | 10 +++++----- Classes/Task/BaseAdditionalFieldProvider.php | 2 +- .../Task/HarvestAdditionalFieldProvider.php | 2 +- .../Task/ReindexAdditionalFieldProvider.php | 2 +- Classes/Updates/FileLocationUpdater.php | 8 ++++---- Classes/Updates/FormatUpdater.php | 6 +++--- Classes/Updates/MigrateSettings.php | 6 +++--- Classes/Updates/UpdateSolrSchema.php | 2 +- 17 files changed, 51 insertions(+), 47 deletions(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index 5f57270ee5..6722fdb15e 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -25,6 +25,8 @@ use Kitodo\Dlf\Validation\DocumentValidator; use Symfony\Component\Console\Command\Command; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; +use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -128,6 +130,8 @@ public function __construct( */ protected function initializeRepositories(int $storagePid): void { + $request = (new ServerRequest())->withAttribute("applicationType", SystemEnvironmentBuilder::REQUESTTYPE_BE); + $this->configurationManager->setRequest($request); $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $frameworkConfiguration['persistence']['storagePid'] = MathUtility::forceIntegerInRange($storagePid, 0); $this->configurationManager->setConfiguration($frameworkConfiguration); @@ -180,7 +184,7 @@ protected function getSolrCores(int $pageId): array $queryBuilder->createNamedParameter($pageId, Connection::PARAM_INT) ) ) - ->execute(); + ->executeQuery(); while ($record = $result->fetchAssociative()) { $solrCores[$record['index_name']] = $record['uid']; diff --git a/Classes/Common/AbstractDocument.php b/Classes/Common/AbstractDocument.php index ed534a47b2..19f1429914 100644 --- a/Classes/Common/AbstractDocument.php +++ b/Classes/Common/AbstractDocument.php @@ -645,7 +645,7 @@ public static function getTitle(int $uid, bool $recursive = false): string Helper::whereExpression('tx_dlf_documents') ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $resArray = $result->fetchAssociative(); if ($resArray) { @@ -762,7 +762,7 @@ protected function loadFormats(): void ->where( $queryBuilder->expr()->eq('pid', $this->configPid) ) - ->execute(); + ->executeQuery(); while ($resArray = $result->fetchAssociative()) { // Update format registry. diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index ef824c005f..490163e978 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -456,7 +456,7 @@ public static function getIndexNameFromUid(int $uid, string $table, int $pid = - $table . '.pid AS pid', ) ->from($table) - ->execute(); + ->executeQuery(); $cache[$table] = []; @@ -542,7 +542,7 @@ public static function getDocumentStructures(int $pid = -1): array ) ->from('tx_dlf_structures') ->where($where) - ->execute(); + ->executeQuery(); $allStructures = $kitodoStructures->fetchAllAssociative(); @@ -733,7 +733,7 @@ public static function translate(string $indexName, string $table, string $pid): self::whereExpression($table, true) ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $row = $result->fetchAssociative(); @@ -749,7 +749,7 @@ public static function translate(string $indexName, string $table, string $pid): self::whereExpression($table, true) ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $row = $result->fetchAssociative(); @@ -784,7 +784,7 @@ public static function translate(string $indexName, string $table, string $pid): self::whereExpression($table, true) ) ->setMaxResults(10000) - ->execute(); + ->executeQuery(); if ($result->rowCount() > 0) { while ($resArray = $result->fetchAssociative()) { diff --git a/Classes/Common/IiifManifest.php b/Classes/Common/IiifManifest.php index 4ba38b6f3c..ba494755f1 100644 --- a/Classes/Common/IiifManifest.php +++ b/Classes/Common/IiifManifest.php @@ -145,7 +145,7 @@ protected function establishRecordId(int $pid): void $queryBuilder->expr()->eq('tx_dlf_metadata.format', 0) ) ) - ->execute(); + ->executeQuery(); while ($resArray = $result->fetchAssociative()) { $recordIdPath = $resArray['querypath']; if (!empty($recordIdPath)) { @@ -575,7 +575,7 @@ public function getMetadata(string $id): array $queryBuilder->expr()->eq('tx_dlf_metadata.format', 0) ) ) - ->execute(); + ->executeQuery(); $iiifResource = $this->iiif->getContainedResourceById($id); while ($resArray = $result->fetchAssociative()) { // Set metadata field's value(s). diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 447929b68b..8042c5e1f9 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -281,7 +281,7 @@ protected static function loadIndexConf(int $pid): void $queryBuilder->expr()->eq('pid', $pid), Helper::whereExpression('tx_dlf_metadata') ) - ->execute(); + ->executeQuery(); while ($indexing = $result->fetchAssociative()) { if ($indexing['index_tokenized']) { diff --git a/Classes/Common/MetsDocument.php b/Classes/Common/MetsDocument.php index 999301f36a..dc53c642c4 100644 --- a/Classes/Common/MetsDocument.php +++ b/Classes/Common/MetsDocument.php @@ -1029,7 +1029,7 @@ private function getAdditionalMetadataFromDatabase(string $dmdId): array $queryBuilder->expr()->eq('tx_dlf_metadataformat_joins.pid', $this->configPid), $queryBuilder->expr()->eq('tx_dlf_formats_joins.type', $queryBuilder->createNamedParameter($this->mdSec[$dmdId]['type'])) ) - ->execute(); + ->executeQuery(); // Get all metadata without a format, but with a default value next. $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('tx_dlf_metadata'); @@ -1051,7 +1051,7 @@ private function getAdditionalMetadataFromDatabase(string $dmdId): array $queryBuilder->expr()->eq('format', 0), $queryBuilder->expr()->neq('default_value', $queryBuilder->createNamedParameter('')) ) - ->execute(); + ->executeQuery(); // Merge both result sets. $allResults = array_merge($resultWithFormat->fetchAllAssociative(), $resultWithoutFormat->fetchAllAssociative()); @@ -1095,8 +1095,8 @@ private function getAdditionalMetadataFromDatabase(string $dmdId): array $queryBuilder->expr()->eq('tx_dlf_subentries_joins.pid', $this->configPid) ) ->orderBy('tx_dlf_subentries_joins.sorting') - ->execute(); - $subentriesResult = $subentries->fetchAll(); + ->executeQuery(); + $subentriesResult = $subentries->fetchAllAssociative(); return array_merge($allResults, ['subentries' => $subentriesResult]); } @@ -1631,7 +1631,7 @@ protected function magicGetThumbnail(): string Helper::whereExpression('tx_dlf_structures') ) ->setMaxResults(1) - ->execute(); + ->executeQUery(); $allResults = $result->fetchAllAssociative(); diff --git a/Classes/Common/Solr/Solr.php b/Classes/Common/Solr/Solr.php index 8fafb4457a..d99be22b1c 100644 --- a/Classes/Common/Solr/Solr.php +++ b/Classes/Common/Solr/Solr.php @@ -214,7 +214,7 @@ public static function escapeQueryKeepField(string $query, int $pid): string ), Helper::whereExpression('tx_dlf_metadata') ) - ->execute(); + ->executeQuery(); while ($resArray = $result->fetchAssociative()) { $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; diff --git a/Classes/Domain/Repository/CollectionRepository.php b/Classes/Domain/Repository/CollectionRepository.php index a6fa806672..5ca88b2ce2 100644 --- a/Classes/Domain/Repository/CollectionRepository.php +++ b/Classes/Domain/Repository/CollectionRepository.php @@ -150,7 +150,7 @@ public function getIndexNameForSolr(array $settings, $set): Result ) ->setMaxResults(1); - return $result->execute(); + return $result->executeQuery(); } } diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 6af978ebea..7f32bd203c 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -281,7 +281,7 @@ public function getStatisticsForSelectedCollection(array $settings): array $queryBuilder->expr()->in('tx_dlf_collections_join.uid', $queryBuilder->createNamedParameter(GeneralUtility::intExplode(',', $settings['collections']), Connection::PARAM_INT_ARRAY)), $queryBuilder->expr()->eq('tx_dlf_relations_joins.ident', $queryBuilder->createNamedParameter('docs_colls')) ) - ->execute() + ->executeQuery() ->fetchFirstColumn(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) @@ -326,7 +326,7 @@ public function getStatisticsForSelectedCollection(array $settings): array $queryBuilder->expr()->in('tx_dlf_collections_join.uid', $queryBuilder->createNamedParameter(GeneralUtility::intExplode(',', $settings['collections']), Connection::PARAM_INT_ARRAY)), $queryBuilder->expr()->eq('tx_dlf_relations_joins.ident', $queryBuilder->createNamedParameter('docs_colls')) ) - ->execute() + ->executeQuery() ->fetchFirstColumn(); } else { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) @@ -341,7 +341,7 @@ public function getStatisticsForSelectedCollection(array $settings): array $queryBuilder->expr()->eq('partof', 0), Helper::whereExpression('tx_dlf_documents') ) - ->execute() + ->executeQuery() ->fetchFirstColumn(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) @@ -365,7 +365,7 @@ public function getStatisticsForSelectedCollection(array $settings): array $queryBuilder->expr()->eq('pid', (int)$settings['storagePid']), $queryBuilder->expr()->notIn('uid', $subQuery) ) - ->execute() + ->executeQuery() ->fetchFirstColumn(); } @@ -421,7 +421,7 @@ public function getTableOfContentsFromDb(int $uid, int $pid, array $settings): R ) ->add('orderBy', 'cast(volume_sorting as UNSIGNED) asc') ->addOrderBy('tx_dlf_documents.mets_orderlabel') - ->execute(); + ->executeQuery(); } /** @@ -542,7 +542,7 @@ public function findAllByUids(array $uids, bool $checkPartof = false): array ) ->add('orderBy', 'cast(volume_sorting as UNSIGNED) asc') ->addOrderBy('mets_orderlabel', 'asc') - ->execute(); + ->executeQuery(); $allDocuments = []; $documentStructures = Helper::getDocumentStructures($this->settings['storagePid']); @@ -685,7 +685,7 @@ public function getPreviousDocumentUid(int $uid): ?int 'volume_sorting < \'' . $currentVolume . '\'' ) ->addOrderBy('volume_sorting', 'desc') - ->execute() + ->executeQuery() ->fetchAssociative(); if (!empty($prevDocument)) { @@ -732,7 +732,7 @@ public function getNextDocumentUid(int $uid): ?int 'volume_sorting > \'' . $currentVolume . '\'' ) ->addOrderBy('volume_sorting', 'asc') - ->execute() + ->executeQuery() ->fetchAssociative(); if (!empty($nextDocument)) { @@ -769,7 +769,7 @@ public function getFirstChild(int $uid): int $queryBuilder->expr()->eq('partof', $uid) ) ->addOrderBy('volume_sorting', 'asc') - ->execute() + ->executeQuery() ->fetchAssociative(); if (empty($child['uid'])) { @@ -802,7 +802,7 @@ public function getLastChild(int $uid): int $queryBuilder->expr()->eq('partof', $uid) ) ->addOrderBy('volume_sorting', 'desc') - ->execute() + ->executeQuery() ->fetchAssociative(); if (empty($child['uid'])) { diff --git a/Classes/Hooks/DataHandler.php b/Classes/Hooks/DataHandler.php index f8485062b6..edaa955c95 100644 --- a/Classes/Hooks/DataHandler.php +++ b/Classes/Hooks/DataHandler.php @@ -132,7 +132,7 @@ public function processDatamap_postProcessFieldArray(string $status, string $tab Helper::whereExpression($table) ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $resArray = $result->fetchAssociative(); if (is_array($resArray)) { @@ -158,7 +158,7 @@ public function processDatamap_postProcessFieldArray(string $status, string $tab Helper::whereExpression($table) ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); if ($resArray = $result->fetchAssociative()) { // Reset indexing to current. @@ -220,7 +220,7 @@ public function processDatamap_afterDatabaseOperations(string $status, string $t ) ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $resArray = $result->fetchAssociative(); if (is_array($resArray)) { @@ -282,7 +282,7 @@ public function processCmdmap_postProcess(string $command, string $table, $id): ) ) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $resArray = $result->fetchAssociative(); if (is_array($resArray)) { @@ -381,7 +381,7 @@ private function deleteSolrCore($id): void ->from('tx_dlf_solrcores') ->where($queryBuilder->expr()->eq('uid', (int) $id)) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $resArray = $result->fetchAssociative(); if (is_array($resArray)) { diff --git a/Classes/Task/BaseAdditionalFieldProvider.php b/Classes/Task/BaseAdditionalFieldProvider.php index 38e8d3c361..5302a685e6 100644 --- a/Classes/Task/BaseAdditionalFieldProvider.php +++ b/Classes/Task/BaseAdditionalFieldProvider.php @@ -309,7 +309,7 @@ private function getSolrCores(?int $pid = null): array ->eq('pid', $queryBuilder->createNamedParameter((int) $pid, Connection::PARAM_INT)) ); } - $result = $queryBuilder->execute(); + $result = $queryBuilder->executeQuery(); while ($record = $result->fetchAssociative()) { $solrCores[$record['label'] . ' (' . $record['index_name'] . ')'] = $record['uid']; diff --git a/Classes/Task/HarvestAdditionalFieldProvider.php b/Classes/Task/HarvestAdditionalFieldProvider.php index ed28250aa6..18f04d22f4 100644 --- a/Classes/Task/HarvestAdditionalFieldProvider.php +++ b/Classes/Task/HarvestAdditionalFieldProvider.php @@ -149,7 +149,7 @@ private function getLibraries(int $pid): array $queryBuilder->expr() ->eq('pid', $queryBuilder->createNamedParameter((int) $pid, Connection::PARAM_INT)) ) - ->execute(); + ->executeQuery(); while ($record = $result->fetchAssociative()) { $libraries[$record['label']] = $record['uid']; diff --git a/Classes/Task/ReindexAdditionalFieldProvider.php b/Classes/Task/ReindexAdditionalFieldProvider.php index 2342dd1e56..d6824ed82e 100644 --- a/Classes/Task/ReindexAdditionalFieldProvider.php +++ b/Classes/Task/ReindexAdditionalFieldProvider.php @@ -141,7 +141,7 @@ private function getCollections(int $pid): array $queryBuilder->expr() ->eq('pid', $queryBuilder->createNamedParameter((int) $pid, Connection::PARAM_INT)) ) - ->execute(); + ->executeQuery(); while ($record = $result->fetchAssociative()) { $collections[$record['label']] = $record['uid']; diff --git a/Classes/Updates/FileLocationUpdater.php b/Classes/Updates/FileLocationUpdater.php index 256f985865..9f62221704 100644 --- a/Classes/Updates/FileLocationUpdater.php +++ b/Classes/Updates/FileLocationUpdater.php @@ -196,7 +196,7 @@ protected function getRecordsFromTable(bool $countOnly = false) ) ) ->orderBy('uid') - ->execute() + ->executeQuery() ->fetchAllAssociative(); if ($countOnly === true) { $numResults += count($result); @@ -293,7 +293,7 @@ protected function migrateField(string $table, array $row): void 'storage', $queryBuilder->createNamedParameter($storageUid, \PDO::PARAM_INT) ) - )->execute()->fetchAssociative(); + )->executeQuery()->fetchAssociative(); // the file exists if (is_array($existingFileRecord)) { @@ -317,7 +317,7 @@ protected function migrateField(string $table, array $row): void $result = $queryBuilder ->insert('sys_file_reference') ->values($fields) - ->execute(); + ->executeStatement(); // Update referencing table's original field to now contain the count of references, // which is "1" in our case. @@ -327,7 +327,7 @@ protected function migrateField(string $table, array $row): void 'uid', $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT) ) - )->set($this->fieldsToMigrate[$table], 1)->execute(); + )->set($this->fieldsToMigrate[$table], 1)->executeStatement(); } } } diff --git a/Classes/Updates/FormatUpdater.php b/Classes/Updates/FormatUpdater.php index 38dbb9bb29..1011ff0e54 100644 --- a/Classes/Updates/FormatUpdater.php +++ b/Classes/Updates/FormatUpdater.php @@ -176,7 +176,7 @@ protected function getRecordsFromTable(bool $countOnly = false): array|int $queryBuilder->expr()->eq('pid', 0) ) ->orderBy('uid') - ->execute() + ->executeQuery() ->fetchAllAssociative(); if ($countOnly === true) { $numResults += count($result); @@ -242,7 +242,7 @@ protected function migrateField(array $row): void $solrQueryBuilder->expr()->eq('uid', 1) ) ->orderBy('uid') - ->execute() + ->executeQuery() ->fetchAssociative(); if ($result !== false) { @@ -252,7 +252,7 @@ protected function migrateField(array $row): void 'uid', $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT) ) - )->set('pid', $result['pid'])->execute(); + )->set('pid', $result['pid'])->executeStatement(); } } } diff --git a/Classes/Updates/MigrateSettings.php b/Classes/Updates/MigrateSettings.php index 51e0fe721c..317c646e4d 100644 --- a/Classes/Updates/MigrateSettings.php +++ b/Classes/Updates/MigrateSettings.php @@ -91,7 +91,7 @@ public function executeUpdate(): bool $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('list')), $queryBuilder->expr()->like('list_type', $queryBuilder->createNamedParameter('dlf_%')) ) - ->execute(); + ->executeQuery(); // Update the found record sets while ($record = $statement->fetchAssociative()) { @@ -104,7 +104,7 @@ public function executeUpdate(): bool ) ) ->set('pi_flexform', $this->migrateFlexFormSettings($record['pi_flexform'])) - ->execute(); + ->executeStatement(); // exit if at least one update statement is not successful if (!((bool) $updateResult)) { @@ -139,7 +139,7 @@ public function updateNecessary(): bool $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('list')), $queryBuilder->expr()->like('list_type', $queryBuilder->createNamedParameter('dlf_%')) ) - ->execute(); + ->executeQuery(); // Update the found record sets while ($record = $statement->fetchAssociative()) { diff --git a/Classes/Updates/UpdateSolrSchema.php b/Classes/Updates/UpdateSolrSchema.php index fdcbfae0e5..cf6d2c70a0 100644 --- a/Classes/Updates/UpdateSolrSchema.php +++ b/Classes/Updates/UpdateSolrSchema.php @@ -161,7 +161,7 @@ private function getAllAffectedSolrCores(): array $allSolrCores = $queryBuilder->select('uid', 'index_name') ->from('tx_dlf_solrcores') - ->execute() + ->executeQuery() ->fetchAllAssociative(); $affectedSolrCores = []; From 63598ea96906517aa4d9975c6312ac8fb78e3c7e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 20:37:09 +0200 Subject: [PATCH 011/111] Fix more querybuilder issues for Typo3 v13 update. --- Classes/Common/Helper.php | 4 ++-- Classes/Common/IiifManifest.php | 8 ++++---- Classes/Common/Solr/Solr.php | 2 +- Classes/Domain/Repository/DocumentRepository.php | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index 490163e978..9e4462ef97 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -765,8 +765,8 @@ public static function translate(string $indexName, string $table, string $pid): if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_metadatasubentries', 'tx_dlf_structures'])) { $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]); if ($languageContentId > 0) { - $additionalWhere = $queryBuilder->expr()->andX( - $queryBuilder->expr()->orX( + $additionalWhere = $queryBuilder->expr()->and( + $queryBuilder->expr()->or( $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]), $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId) ), diff --git a/Classes/Common/IiifManifest.php b/Classes/Common/IiifManifest.php index ba494755f1..dc4755b6e4 100644 --- a/Classes/Common/IiifManifest.php +++ b/Classes/Common/IiifManifest.php @@ -135,8 +135,8 @@ protected function establishRecordId(int $pid): void ->where( $queryBuilder->expr()->eq('tx_dlf_metadata.pid', (int) $pid), $queryBuilder->expr()->eq('tx_dlf_metadataformat.pid', (int) $pid), - $queryBuilder->expr()->orX( - $queryBuilder->expr()->andX( + $queryBuilder->expr()->or( + $queryBuilder->expr()->and( $queryBuilder->expr()->eq('tx_dlf_metadata.uid', 'tx_dlf_metadataformat.parent_id'), $queryBuilder->expr()->eq('tx_dlf_metadataformat.encoded', 'tx_dlf_formats.uid'), $queryBuilder->expr()->eq('tx_dlf_metadata.index_name', $queryBuilder->createNamedParameter('record_id')), @@ -566,8 +566,8 @@ public function getMetadata(string $id): array ->where( $queryBuilder->expr()->eq('tx_dlf_metadata.pid', $this->configPid), $queryBuilder->expr()->eq('tx_dlf_metadataformat.pid', $this->configPid), - $queryBuilder->expr()->orX( - $queryBuilder->expr()->andX( + $queryBuilder->expr()->or( + $queryBuilder->expr()->and( $queryBuilder->expr()->eq('tx_dlf_metadata.uid', 'tx_dlf_metadataformat.parent_id'), $queryBuilder->expr()->eq('tx_dlf_metadataformat.encoded', 'tx_dlf_formats.uid'), $queryBuilder->expr()->eq('tx_dlf_formats.type', $queryBuilder->createNamedParameter($this->getIiifVersion())) diff --git a/Classes/Common/Solr/Solr.php b/Classes/Common/Solr/Solr.php index d99be22b1c..975a20d710 100644 --- a/Classes/Common/Solr/Solr.php +++ b/Classes/Common/Solr/Solr.php @@ -208,7 +208,7 @@ public static function escapeQueryKeepField(string $query, int $pid): string ->where( $queryBuilder->expr()->eq('index_indexed', 1), $queryBuilder->expr()->eq('pid', (int) $pid), - $queryBuilder->expr()->orX( + $queryBuilder->expr()->or( $queryBuilder->expr()->in('sys_language_uid', [-1, 0]), $queryBuilder->expr()->eq('l18n_parent', 0) ), diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 7f32bd203c..d26b2242f9 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -520,7 +520,7 @@ public function findAllByUids(array $uids, bool $checkPartof = false): array // Fetch document info for UIDs in $documentSet from DB $exprDocumentMatchesUid = $queryBuilder->expr()->in('uid', $uids); if ($checkPartof) { - $exprDocumentMatchesUid = $queryBuilder->expr()->orX( + $exprDocumentMatchesUid = $queryBuilder->expr()->or( $exprDocumentMatchesUid, $queryBuilder->expr()->in('partof', $uids) ); @@ -540,7 +540,8 @@ public function findAllByUids(array $uids, bool $checkPartof = false): array $queryBuilder->expr()->in('pid', $this->settings['storagePid']), $exprDocumentMatchesUid ) - ->add('orderBy', 'cast(volume_sorting as UNSIGNED) asc') + ->getConcreteQueryBuilder() + ->orderBy('cast(volume_sorting as UNSIGNED)', 'asc') ->addOrderBy('mets_orderlabel', 'asc') ->executeQuery(); From b23c3ba741dda0a6577ffbf2953012b155bc3ac9 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Aug 2025 20:51:43 +0200 Subject: [PATCH 012/111] Fix NavigationController.php for Typo3 v13 update. --- Classes/Controller/NavigationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/NavigationController.php b/Classes/Controller/NavigationController.php index 9723754b22..16b2258fcd 100644 --- a/Classes/Controller/NavigationController.php +++ b/Classes/Controller/NavigationController.php @@ -101,7 +101,7 @@ public function mainAction(): ResponseInterface $this->view->assign('numPages', $this->document->getCurrentDocument()->numPages); $this->view->assign('viewData', $this->viewData); - $searchSessionParameters = $GLOBALS['TSFE']->fe_user->getKey('ses', 'search'); + $searchSessionParameters = $this->request->getAttribute('frontend.user')->getKey('ses', 'search'); if ($searchSessionParameters) { $lastSearchArguments = [ 'tx_dlf_listview' => [ From b627ea332a77adc332f753acc75f20787d4ddc90 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 7 Aug 2025 12:53:44 +0200 Subject: [PATCH 013/111] Fix exception indexing page without fulltext. --- Classes/Common/MetsDocument.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Classes/Common/MetsDocument.php b/Classes/Common/MetsDocument.php index 999301f36a..21d25b6da7 100644 --- a/Classes/Common/MetsDocument.php +++ b/Classes/Common/MetsDocument.php @@ -1179,10 +1179,17 @@ public function getFullText(string $id): string if (!empty($physicalStructureNode)) { while ($useGroup = array_shift($useGroups)) { - $fileLocations[$useGroup] = $this->getFileLocation($physicalStructureNode['files'][$useGroup]); + if (in_array($useGroup, $physicalStructureNode['files'])) { + $fileLocations[$useGroup] = $this->getFileLocation($physicalStructureNode['files'][$useGroup]); + } } } + if (empty($fileLocations)) { + $this->logger->error('No file locations for fulltext @ID "' . $id . '"'); + return $fullText; + } + $fullText = GeneralUtility::makeInstance(FullTextReader::class, $this->formats)->getFromXml($id, $fileLocations, $physicalStructureNode); } From d5dd3da5af018a1194cbf21aa473f82f2fd971b6 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 7 Aug 2025 13:11:34 +0200 Subject: [PATCH 014/111] Fix error if there is no previous or next document. --- Classes/Domain/Repository/DocumentRepository.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 6af978ebea..e6e07473a0 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -692,7 +692,10 @@ public function getPreviousDocumentUid(int $uid): ?int return $prevDocument['uid']; } - return $this->getLastChild($this->getPreviousDocumentUid($parentId)); + $previousDocumentId = $this->getPreviousDocumentUid($parentId); + if ($previousDocumentId) { + return $this->getLastChild($previousDocumentId); + } } } @@ -739,7 +742,10 @@ public function getNextDocumentUid(int $uid): ?int return $nextDocument['uid']; } - return $this->getFirstChild($this->getNextDocumentUid($parentId)); + $nextDocumentId = $this->getNextDocumentUid($parentId); + if ($nextDocumentId) { + return $this->getFirstChild($nextDocumentId); + } } } From 33097b35157b3377a0f47f08d50236d244670e01 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 8 Aug 2025 12:37:55 +0200 Subject: [PATCH 015/111] Update composer dependencies for typo3 testing framework and phpunit for Typo3 v13 compatibility. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b8d07b1200..11081a9e7c 100644 --- a/composer.json +++ b/composer.json @@ -45,13 +45,13 @@ }, "require-dev": { "phpstan/phpstan": "^1.12", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.1", "spatie/phpunit-watcher": "^1.23", "typo3/cms-backend": "^12.4|^13.4", "typo3/cms-fluid": "^12.4|^13.4", "typo3/cms-fluid-styled-content": "^12.4|^13.4", "typo3/cms-frontend": "^12.4|^13.4", - "typo3/testing-framework": "^7.1", + "typo3/testing-framework": "^8.2", "vlucas/phpdotenv": "^5.6" }, "replace": { From 74a1f76612df446258045c5005c1371310bd5715 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 8 Aug 2025 12:51:27 +0200 Subject: [PATCH 016/111] Fix query in DocumentRespository due to deprecation upgrading to Typo3 v13. --- Classes/Domain/Repository/DocumentRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index ace1a43ccf..fa304be509 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -419,7 +419,8 @@ public function getTableOfContentsFromDb(int $uid, int $pid, array $settings): R $queryBuilder->expr()->eq('tx_dlf_structures_join.pid', intval($pid)), $excludeOtherWhere ) - ->add('orderBy', 'cast(volume_sorting as UNSIGNED) asc') + ->getConcreteQueryBuilder() + ->orderBy('cast(volume_sorting as UNSIGNED)', 'asc') ->addOrderBy('tx_dlf_documents.mets_orderlabel') ->executeQuery(); } From c13a7437cc808dc7f388a14188c62414666e032a Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 8 Aug 2025 12:54:44 +0200 Subject: [PATCH 017/111] Fix wrong viewer Javascript is triggered beacuse multi-view setting is not considered. --- Classes/Controller/PageViewController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/PageViewController.php b/Classes/Controller/PageViewController.php index 4fc71e123a..985f16f042 100644 --- a/Classes/Controller/PageViewController.php +++ b/Classes/Controller/PageViewController.php @@ -463,7 +463,7 @@ protected function getFulltext(int $page): array */ protected function addViewerJS(): void { - if (is_array($this->documentArray) && count($this->documentArray) > 1) { + if ($this->settings['multiViewType'] && is_array($this->documentArray) && count($this->documentArray) > 1) { $jsViewer = 'tx_dlf_viewer = [];'; $i = 0; foreach ($this->documentArray as $document) { From 82b89ec4eed2ca926b17ff75fa5bae8da0288334 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 8 Aug 2025 15:40:36 +0200 Subject: [PATCH 018/111] Fix exception when filtering search results via facet constraints. --- Classes/Controller/ListViewController.php | 2 +- Classes/Controller/SearchController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Controller/ListViewController.php b/Classes/Controller/ListViewController.php index c065998780..8de90884a8 100644 --- a/Classes/Controller/ListViewController.php +++ b/Classes/Controller/ListViewController.php @@ -79,7 +79,7 @@ public function injectMetadataRepository(MetadataRepository $metadataRepository) public function mainAction(): ResponseInterface { $this->search = $this->getParametersSafely('search'); - $this->search = is_array($this->search) ? array_filter($this->search, 'strlen') : []; + $this->search = is_array($this->search) ? $this->search : []; // extract collection(s) from collection parameter $collections = []; diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index b6cd3521f0..58800b0a8a 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -135,7 +135,7 @@ public function mainAction(): ResponseInterface $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->search); } - $this->search = is_array($this->search) ? array_filter($this->search, 'strlen') : []; + $this->search = is_array($this->search) ? $this->search : []; // sanitize date search input if (array_key_exists('dateFrom', $this->search) || array_key_exists('dateTo', $this->search)) { From 01598c271034c7405f2556e773e064c7cf418e5c Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 8 Aug 2025 16:12:26 +0200 Subject: [PATCH 019/111] Fix storing search parameters as session parameter for Typo3 v13 update. --- Classes/Controller/SearchController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index 07ad12dc67..bc1e080f59 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -131,7 +131,7 @@ public function mainAction(): ResponseInterface if (isset($listRequestData['search']) && is_array($listRequestData['search'])) { $this->search = array_merge($this->search ?: [], $listRequestData['search']); $listViewSearch = true; - $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->search); + $this->request->getAttribute('frontend.user')->setKey('ses', 'search', $this->search); } $this->search = is_array($this->search) ? $this->search : []; From 7979268c635f68d1be5ed0cae361b1c7f6b56cef Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 12:29:41 +0200 Subject: [PATCH 020/111] Update FlashMessage severities to use ContextualFeedbackSeverity enum. --- Classes/Common/Helper.php | 5 +- Classes/Common/Indexer.php | 10 ++-- Classes/Common/KitodoFlashMessageRenderer.php | 50 ++----------------- Classes/Hooks/ConfigurationForm.php | 6 +-- .../EditInProductionWarning.php | 4 +- .../Form/FieldInformation/SolrCoreStatus.php | 6 +-- Classes/Task/BaseAdditionalFieldProvider.php | 12 ++--- Classes/Task/BaseTask.php | 12 +++-- Classes/Task/DeleteTask.php | 5 +- Classes/Task/HarvestTask.php | 5 +- Classes/Task/IndexTask.php | 5 +- Classes/Task/OptimizeTask.php | 5 +- Classes/Task/ReindexTask.php | 5 +- Classes/Task/SuggestBuildTask.php | 5 +- 14 files changed, 51 insertions(+), 84 deletions(-) diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index 9e4462ef97..6d557ed50d 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -27,6 +27,7 @@ use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Resource\MimeTypeCollection; use TYPO3\CMS\Core\Resource\MimeTypeDetector; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -85,13 +86,13 @@ class Helper * * @param string $message The body of the message * @param string $title The title of the message - * @param int $severity The message's severity + * @param ContextualFeedbackSeverity $severity The message's severity * @param bool $session Should the message be saved in the user's session? * @param string $queue The queue's unique identifier * * @return FlashMessageQueue The queue the message was added to */ - public static function addMessage(string $message, string $title, int $severity, bool $session = false, string $queue = 'kitodo.default.flashMessages'): FlashMessageQueue + public static function addMessage(string $message, string $title, ContextualFeedbackSeverity $severity, bool $session = false, string $queue = 'kitodo.default.flashMessages'): FlashMessageQueue { $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue); diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index e3a264adf5..40ce2c447b 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -21,7 +21,7 @@ use Symfony\Component\Console\Input\InputInterface; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Core\Environment; @@ -153,7 +153,7 @@ public static function add(Document $document, DocumentRepository $documentRepos self::addMessage( sprintf(Helper::getLanguageService()->getLL('flash.documentIndexed'), $document->getTitle(), $document->getUid()), 'flash.done', - FlashMessage::OK + ContextualFeedbackSeverity::OK ); } else { self::addErrorMessage(sprintf(Helper::getLanguageService()->getLL('flash.documentNotIndexed'), $document->getTitle(), $document->getUid())); @@ -169,7 +169,7 @@ public static function add(Document $document, DocumentRepository $documentRepos self::addMessage( Helper::getLanguageService()->getLL('flash.solrNoConnection'), 'flash.warning', - FlashMessage::WARNING + ContextualFeedbackSeverity::WARNING ); } Helper::error('Could not connect to Apache Solr server'); @@ -202,7 +202,7 @@ public static function delete(InputInterface $input, string $field, int $solrCor Helper::addMessage( Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), Helper::getLanguageService()->getLL('flash.error'), - FlashMessage::ERROR, + ContextualFeedbackSeverity::ERROR, true, 'core.template.flashMessages' ); @@ -748,7 +748,7 @@ private static function addErrorMessage(string $message): void self::addMessage( $message, 'flash.error', - FlashMessage::ERROR + ContextualFeedbackSeverity::ERROR ); } diff --git a/Classes/Common/KitodoFlashMessageRenderer.php b/Classes/Common/KitodoFlashMessageRenderer.php index d9acb0c819..a05bc2b39b 100644 --- a/Classes/Common/KitodoFlashMessageRenderer.php +++ b/Classes/Common/KitodoFlashMessageRenderer.php @@ -14,6 +14,7 @@ use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; /** * A class representing a bootstrap flash messages. @@ -29,30 +30,6 @@ */ class KitodoFlashMessageRenderer implements FlashMessageRendererInterface { - /** - * @var array The message severity class names - */ - protected static array $classes = [ - // Todo: FlashMessage constants deprecated in v12, remove when dropping v11 support - FlashMessage::NOTICE => 'notice', - FlashMessage::INFO => 'info', - FlashMessage::OK => 'success', - FlashMessage::WARNING => 'warning', - FlashMessage::ERROR => 'danger' - ]; - - /** - * @var array The message severity icon names - */ - protected static array $icons = [ - // Todo: FlashMessage constants deprecated in v12, remove when dropping v11 support - FlashMessage::NOTICE => 'lightbulb-o', - FlashMessage::INFO => 'info', - FlashMessage::OK => 'check', - FlashMessage::WARNING => 'exclamation', - FlashMessage::ERROR => 'times' - ]; - /** * Render method * @@ -67,27 +44,6 @@ public function render(array $flashMessages): string return $this->getMessageAsMarkup($flashMessages); } - /** - * Gets the message severity as integer value for compatibility with Typo3 v12 - * - * @access public - * - * @param FlashMessage $flashMessage - * - * @return int The message severity as integer - */ - protected function getSeverityAsInt(FlashMessage $flashMessage): int - { - $severity = $flashMessage->getSeverity(); - if (is_int($severity)) { - // $severity is integer constant from FlashMessage in Typo3 v11 - return $severity; - } - // $severity is instance of ContextualFeedbackSeverity enum introduced in Typo3 v12 - // TODO: migrate message severity to ContextualFeedbackSeverity when dropping support for Typo3 v11 - return $severity->value; - } - /** * Gets the message severity class name * @@ -99,7 +55,7 @@ protected function getSeverityAsInt(FlashMessage $flashMessage): int */ protected function getClass(FlashMessage $flashMessage): string { - return 'alert-' . self::$classes[$this->getSeverityAsInt($flashMessage)]; + return $flashMessage->getSeverity()->getCssClass(); } /** @@ -113,7 +69,7 @@ protected function getClass(FlashMessage $flashMessage): string */ protected function getIconName(FlashMessage $flashMessage): string { - return self::$icons[$this->getSeverityAsInt($flashMessage)]; + return $flashMessage->getSeverity()->getIconIdentifier(); } /** diff --git a/Classes/Hooks/ConfigurationForm.php b/Classes/Hooks/ConfigurationForm.php index f79d01fd7f..e62c3140ee 100644 --- a/Classes/Hooks/ConfigurationForm.php +++ b/Classes/Hooks/ConfigurationForm.php @@ -14,7 +14,7 @@ use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Solr\Solr; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; /** * Hooks and helper for \TYPO3\CMS\Core\TypoScript\ConfigurationForm @@ -41,13 +41,13 @@ public function checkSolrConnection(): string Helper::addMessage( Helper::getLanguageService()->getLL('solr.status'), Helper::getLanguageService()->getLL('solr.connected'), - FlashMessage::OK + ContextualFeedbackSeverity::OK ); } else { Helper::addMessage( Helper::getLanguageService()->getLL('solr.error'), Helper::getLanguageService()->getLL('solr.notConnected'), - FlashMessage::WARNING + ContextualFeedbackSeverity::WARNING ); } return Helper::renderFlashMessages(); diff --git a/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php b/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php index 386cf2de2f..8e245e8c2b 100644 --- a/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php +++ b/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php @@ -14,7 +14,7 @@ use Kitodo\Dlf\Common\Helper; use TYPO3\CMS\Backend\Form\AbstractNode; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; /** * FieldInformation renderType for TYPO3 FormEngine @@ -44,7 +44,7 @@ public function render(): array Helper::addMessage( htmlspecialchars(Helper::getLanguageService()->getLL('flash.editInProductionWarning')), '', // We must not set a title/header, because

isn't allowed in FieldInformation. - FlashMessage::WARNING + ContextualFeedbackSeverity::WARNING ); // Add message to result array. $result['html'] = Helper::renderFlashMessages(); diff --git a/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php b/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php index f45f4e82ee..546d4610c9 100644 --- a/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php +++ b/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php @@ -16,7 +16,7 @@ use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Solr\Solr; use TYPO3\CMS\Backend\Form\AbstractNode; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; /** * FieldInformation renderType for TYPO3 FormEngine @@ -73,7 +73,7 @@ public function render(): array Helper::addMessage( sprintf(Helper::getLanguageService()->getLL('flash.coreStatus'), $startTime, $uptime, $lastModified, $numDocuments), '', // We must not set a title/header, because

isn't allowed in FieldInformation. - FlashMessage::INFO + ContextualFeedbackSeverity::INFO ); } } else { @@ -81,7 +81,7 @@ public function render(): array Helper::addMessage( Helper::getLanguageService()->getLL('solr.error'), '', // We must not set a title/header, because

isn't allowed in FieldInformation. - FlashMessage::ERROR + ContextualFeedbackSeverity::ERROR ); } // Add message to result array. diff --git a/Classes/Task/BaseAdditionalFieldProvider.php b/Classes/Task/BaseAdditionalFieldProvider.php index 5302a685e6..1cfc0b35ad 100644 --- a/Classes/Task/BaseAdditionalFieldProvider.php +++ b/Classes/Task/BaseAdditionalFieldProvider.php @@ -15,7 +15,7 @@ use TYPO3\CMS\Backend\Tree\Repository\PageTreeRepository; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; @@ -58,7 +58,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_tasks.xlf'); $messageTitle = Helper::getLanguageService()->getLL('additionalFields.error'); - $messageSeverity = FlashMessage::ERROR; + $messageSeverity = ContextualFeedbackSeverity::ERROR; if (isset($submittedData['doc']) && empty($submittedData['doc'])) { Helper::addMessage( @@ -95,7 +95,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC if (!$submittedData['uid']) { $messageTitle = Helper::getLanguageService()->getLL('additionalFields.warning'); - $messageSeverity = FlashMessage::WARNING; + $messageSeverity = ContextualFeedbackSeverity::WARNING; } if ((isset($submittedData['lib']) && (int) $submittedData['lib'] <= 0)) { @@ -106,7 +106,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC true, 'core.template.flashMessages' ); - $fieldsValid = $messageSeverity === FlashMessage::ERROR ? false : $fieldsValid; + $fieldsValid = $messageSeverity === ContextualFeedbackSeverity::ERROR ? false : $fieldsValid; } if ((isset($submittedData['solr']) && (int) $submittedData['solr'] <= 0) || !isset($submittedData['solr'])) { @@ -117,7 +117,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC true, 'core.template.flashMessages' ); - $fieldsValid = $messageSeverity === FlashMessage::ERROR ? false : $fieldsValid; + $fieldsValid = $messageSeverity === ContextualFeedbackSeverity::ERROR ? false : $fieldsValid; } if (((isset($submittedData['coll']) && isset($submittedData['all'])) || (!isset($submittedData['coll']) && !isset($submittedData['all']))) @@ -129,7 +129,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC true, 'core.template.flashMessages' ); - $fieldsValid = $messageSeverity === FlashMessage::ERROR ? false : $fieldsValid; + $fieldsValid = $messageSeverity === ContextualFeedbackSeverity::ERROR ? false : $fieldsValid; } return $fieldsValid; } diff --git a/Classes/Task/BaseTask.php b/Classes/Task/BaseTask.php index 815eda5824..131a75d7fd 100644 --- a/Classes/Task/BaseTask.php +++ b/Classes/Task/BaseTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use Kitodo\Dlf\Common\Helper; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Scheduler\Task\AbstractTask; /** @@ -372,11 +372,11 @@ public function setOptimize(bool $optimize): void * @access protected * * @param string $message Messages separated by PHP_EOL - * @param int $severity + * @param ContextualFeedbackSeverity $severity * * @return void */ - protected function outputFlashMessages(string $message, int $severity): void + protected function outputFlashMessages(string $message, ContextualFeedbackSeverity $severity): void { $messages = explode(PHP_EOL, $message); @@ -385,10 +385,14 @@ protected function outputFlashMessages(string $message, int $severity): void continue; } + if ($severity !== ContextualFeedbackSeverity::ERROR) { + $severity = ContextualFeedbackSeverity::OK; + } + Helper::addMessage( $message, '', - $severity == FlashMessage::ERROR ? FlashMessage::ERROR : FlashMessage::OK, + $severity, true, 'core.template.flashMessages' ); diff --git a/Classes/Task/DeleteTask.php b/Classes/Task/DeleteTask.php index 0ac9b594af..4e3c6e6efc 100644 --- a/Classes/Task/DeleteTask.php +++ b/Classes/Task/DeleteTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -46,7 +46,8 @@ public function execute() $return = $deleteCommand->run($inputInterface, $outputInterface); if (!Environment::isCli()) { - $this->outputFlashMessages($outputInterface->fetch(), $return ? FlashMessage::ERROR : FlashMessage::OK); + $severity = $return ? ContextualFeedbackSeverity::ERROR : ContextualFeedbackSeverity::OK; + $this->outputFlashMessages($outputInterface->fetch(), $severity); } return !$return; } diff --git a/Classes/Task/HarvestTask.php b/Classes/Task/HarvestTask.php index 145243a516..5cbf887cb3 100644 --- a/Classes/Task/HarvestTask.php +++ b/Classes/Task/HarvestTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -58,7 +58,8 @@ public function execute() $return = $harvestCommand->run($inputInterface, $outputInterface); if (!Environment::isCli()) { - $this->outputFlashMessages($outputInterface->fetch(), $return ? FlashMessage::ERROR : FlashMessage::OK); + $severity = $return ? ContextualFeedbackSeverity::ERROR : ContextualFeedbackSeverity::OK; + $this->outputFlashMessages($outputInterface->fetch(), $severity); } return !$return; } diff --git a/Classes/Task/IndexTask.php b/Classes/Task/IndexTask.php index 7a45e2366c..e31d208277 100644 --- a/Classes/Task/IndexTask.php +++ b/Classes/Task/IndexTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -52,7 +52,8 @@ public function execute() $return = $indexCommand->run($inputInterface, $outputInterface); if (!Environment::isCli()) { - $this->outputFlashMessages($outputInterface->fetch(), $return ? FlashMessage::ERROR : FlashMessage::OK); + $severity = $return ? ContextualFeedbackSeverity::ERROR : ContextualFeedbackSeverity::OK; + $this->outputFlashMessages($outputInterface->fetch(), $severity); } return !$return; } diff --git a/Classes/Task/OptimizeTask.php b/Classes/Task/OptimizeTask.php index d028b8d263..7b36ffaaa9 100644 --- a/Classes/Task/OptimizeTask.php +++ b/Classes/Task/OptimizeTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -47,7 +47,8 @@ public function execute() $return = $optimizeCommand->run($inputInterface, $outputInterface); if (!Environment::isCli()) { - $this->outputFlashMessages($outputInterface->fetch(), $return ? FlashMessage::ERROR : FlashMessage::OK); + $severity = $return ? ContextualFeedbackSeverity::ERROR : ContextualFeedbackSeverity::OK; + $this->outputFlashMessages($outputInterface->fetch(), $severity); } return !$return; } diff --git a/Classes/Task/ReindexTask.php b/Classes/Task/ReindexTask.php index 88bc7e752a..7489be7344 100644 --- a/Classes/Task/ReindexTask.php +++ b/Classes/Task/ReindexTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -57,7 +57,8 @@ public function execute() $return = $reindexCommand->run($inputInterface, $outputInterface); if (!Environment::isCli()) { - $this->outputFlashMessages($outputInterface->fetch(), $return ? FlashMessage::ERROR : FlashMessage::OK); + $severity = $return ? ContextualFeedbackSeverity::ERROR : ContextualFeedbackSeverity::OK; + $this->outputFlashMessages($outputInterface->fetch(), $severity); } return !$return; } diff --git a/Classes/Task/SuggestBuildTask.php b/Classes/Task/SuggestBuildTask.php index 01e548f0d4..b1a81c8f9e 100644 --- a/Classes/Task/SuggestBuildTask.php +++ b/Classes/Task/SuggestBuildTask.php @@ -12,7 +12,7 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -41,7 +41,8 @@ public function execute() $return = $suggestBuildCommand->run($inputInterface, $outputInterface); if (!Environment::isCli()) { - $this->outputFlashMessages($outputInterface->fetch(), $return ? FlashMessage::ERROR : FlashMessage::OK); + $severity = $return ? ContextualFeedbackSeverity::ERROR : ContextualFeedbackSeverity::OK; + $this->outputFlashMessages($outputInterface->fetch(), $severity); } return !$return; } From 37816050b183d6758d365532f656048baa60e475 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 13:01:55 +0200 Subject: [PATCH 021/111] Fix custom rendering of FlashMessages in form fields. Remove flash message icon rendering which is not allowed and causes RuntimeError. --- Classes/Common/KitodoFlashMessageRenderer.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Classes/Common/KitodoFlashMessageRenderer.php b/Classes/Common/KitodoFlashMessageRenderer.php index a05bc2b39b..4204d1caf2 100644 --- a/Classes/Common/KitodoFlashMessageRenderer.php +++ b/Classes/Common/KitodoFlashMessageRenderer.php @@ -55,7 +55,7 @@ public function render(array $flashMessages): string */ protected function getClass(FlashMessage $flashMessage): string { - return $flashMessage->getSeverity()->getCssClass(); + return 'alert-' . $flashMessage->getSeverity()->getCssClass(); } /** @@ -83,7 +83,7 @@ protected function getIconName(FlashMessage $flashMessage): string */ protected function getMessageAsMarkup(array $flashMessages): string { - // \TYPO3\CMS\Core\Messaging\FlashMessage::getMessageAsMarkup() uses htmlspecialchars() + // \TYPO3\CMS\Core\Messaging\Renderer\BootstrapRenderer::render() uses htmlspecialchars() // on all messages, but we have messages with HTML tags. Therefore we copy the official // implementation and remove the htmlspecialchars() call on the message body. $markup = []; @@ -91,16 +91,10 @@ protected function getMessageAsMarkup(array $flashMessages): string foreach ($flashMessages as $flashMessage) { $messageTitle = $flashMessage->getTitle(); $markup[] = '
'; - $markup[] = '
'; - $markup[] = '
'; - $markup[] = ' '; - $markup[] = ' '; - $markup[] = ' '; - $markup[] = ' '; - $markup[] = '
'; - $markup[] = '
'; + $markup[] = '
'; + $markup[] = '
'; if ($messageTitle !== '') { - $markup[] = '

' . htmlspecialchars($messageTitle) . '

'; + $markup[] = '
' . htmlspecialchars($messageTitle) . '
'; } $markup[] = '

' . $flashMessage->getMessage() . '

'; $markup[] = '
'; From 3f63717932fd9019813d4cea8b058d837fe7842e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 13:29:02 +0200 Subject: [PATCH 022/111] Dynamically instantiate FrontendTypoScriptFactory in TypoScriptHelper which is not available in Typo3 v12 to prevent autowire error. --- Classes/Common/TypoScriptHelper.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index 0917c7c06b..64e75a2c3a 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Common; +use Psr\Container\ContainerInterface; +use Psr\EventDispatcher\EventDispatcherInterface; use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Context\Context; @@ -19,8 +21,11 @@ use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Routing\PageArguments; use TYPO3\CMS\Core\Site\SiteFinder; -use TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory; use TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateRepository; +use TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateTreeBuilder; +use TYPO3\CMS\Core\TypoScript\IncludeTree\Traverser\ConditionVerdictAwareIncludeTreeTraverser; +use TYPO3\CMS\Core\TypoScript\IncludeTree\Traverser\IncludeTreeTraverser; +use TYPO3\CMS\Core\TypoScript\Tokenizer\LossyTokenizer; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\RootlineUtility; use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; @@ -33,7 +38,12 @@ class TypoScriptHelper { public function __construct( - private readonly FrontendTypoScriptFactory $frontendTypoScriptFactory, + private readonly ContainerInterface $container, + private readonly EventDispatcherInterface $eventDispatcher, + private readonly SysTemplateTreeBuilder $treeBuilder, + private readonly LossyTokenizer $tokenizer, + private readonly IncludeTreeTraverser $includeTreeTraverser, + private readonly ConditionVerdictAwareIncludeTreeTraverser $includeTreeTraverserConditionVerdictAware, private readonly SysTemplateRepository $sysTemplateRepository, ) {} @@ -54,14 +64,24 @@ public function getTyposcriptConfigV13(int $pid): array $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pid)->get(); $sysTemplateRows = $this->sysTemplateRepository->getSysTemplateRowsByRootline($rootLine); - $frontendTypoScript = $this->frontendTypoScriptFactory->createSettingsAndSetupConditions( + $frontendTypoScriptFactory = GeneralUtility::makeInstance( + \TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory::class, + $this->container, + $this->eventDispatcher, + $this->treeBuilder, + $this->tokenizer, + $this->includeTreeTraverser, + $this->includeTreeTraverserConditionVerdictAware, + ); + + $frontendTypoScript = $frontendTypoScriptFactory->createSettingsAndSetupConditions( $site, $sysTemplateRows, [], null, ); - $ts = $this->frontendTypoScriptFactory->createSetupConfigOrFullSetup( + $ts = $frontendTypoScriptFactory->createSetupConfigOrFullSetup( true, $frontendTypoScript, $site, From d3587aa02a3b982297732c7e8d39c4e3613c69f7 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 16:07:06 +0200 Subject: [PATCH 023/111] Migrate language service translation calls for Typo3 v13 support. --- Classes/Common/Indexer.php | 29 ++++++++++++++----- Classes/Hooks/ConfigurationForm.php | 22 ++++---------- .../EditInProductionWarning.php | 4 +-- .../Form/FieldInformation/SolrCoreStatus.php | 10 +++---- Classes/Task/BaseAdditionalFieldProvider.php | 20 ++++++------- Configuration/TCA/Overrides/tt_content.php | 2 +- 6 files changed, 43 insertions(+), 44 deletions(-) diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 40ce2c447b..191bcd1a1a 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -43,6 +43,11 @@ class Indexer */ public static string $extKey = 'dlf'; + /** + * Prefix for translation keys. + */ + const LANG_PREFIX = 'LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:'; + /** * @access protected * @static @@ -151,12 +156,20 @@ public static function add(Document $document, DocumentRepository $documentRepos if (!(Environment::isCli())) { if ($success) { self::addMessage( - sprintf(Helper::getLanguageService()->getLL('flash.documentIndexed'), $document->getTitle(), $document->getUid()), + sprintf( + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentIndexed'), + $document->getTitle(), + $document->getUid() + ), 'flash.done', ContextualFeedbackSeverity::OK ); } else { - self::addErrorMessage(sprintf(Helper::getLanguageService()->getLL('flash.documentNotIndexed'), $document->getTitle(), $document->getUid())); + self::addErrorMessage(sprintf( + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentNotIndexed'), + $document->getTitle(), + $document->getUid() + )); } } return $success; @@ -167,7 +180,7 @@ public static function add(Document $document, DocumentRepository $documentRepos } else { if (!(Environment::isCli())) { self::addMessage( - Helper::getLanguageService()->getLL('flash.solrNoConnection'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.solrNoConnection'), 'flash.warning', ContextualFeedbackSeverity::WARNING ); @@ -200,8 +213,8 @@ public static function delete(InputInterface $input, string $field, int $solrCor } catch (\Exception $e) { if (!(Environment::isCli())) { Helper::addMessage( - Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), - Helper::getLanguageService()->getLL('flash.error'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.solrException') . ' ' . htmlspecialchars($e->getMessage()), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.error'), ContextualFeedbackSeverity::ERROR, true, 'core.template.flashMessages' @@ -727,7 +740,7 @@ private static function removeAppendsFromAuthor(array|string $authors): array|st private static function handleException(string $errorMessage): void { if (!(Environment::isCli())) { - self::addErrorMessage(Helper::getLanguageService()->getLL('flash.solrException') . '
' . htmlspecialchars($errorMessage)); + self::addErrorMessage(Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.solrException') . '
' . htmlspecialchars($errorMessage)); } Helper::error('Apache Solr threw exception: "' . $errorMessage . '"'); } @@ -769,8 +782,8 @@ private static function addMessage(string $message, string $type, int $status): { Helper::addMessage( $message, - Helper::getLanguageService()->getLL($type), - $status, + Helper::getLanguageService()->sL(self::LANG_PREFIX . $type), + $severity, true, 'core.template.flashMessages' ); diff --git a/Classes/Hooks/ConfigurationForm.php b/Classes/Hooks/ConfigurationForm.php index e62c3140ee..c0f9f7e47a 100644 --- a/Classes/Hooks/ConfigurationForm.php +++ b/Classes/Hooks/ConfigurationForm.php @@ -26,6 +26,7 @@ */ class ConfigurationForm { + const LANG_PREFIX = 'LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:'; /** * Check if a connection to a Solr server could be established with the given credentials. @@ -39,31 +40,18 @@ public function checkSolrConnection(): string $solr = Solr::getInstance(); if ($solr->ready) { Helper::addMessage( - Helper::getLanguageService()->getLL('solr.status'), - Helper::getLanguageService()->getLL('solr.connected'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'solr.status'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'solr.connected'), ContextualFeedbackSeverity::OK ); } else { Helper::addMessage( - Helper::getLanguageService()->getLL('solr.error'), - Helper::getLanguageService()->getLL('solr.notConnected'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'solr.error'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'solr.notConnected'), ContextualFeedbackSeverity::WARNING ); } return Helper::renderFlashMessages(); } - /** - * This is the constructor. - * - * @access public - * - * @return void - */ - public function __construct() - { - // Load backend localization file. - Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf'); - } - } diff --git a/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php b/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php index 8e245e8c2b..27ab4ec816 100644 --- a/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php +++ b/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php @@ -38,11 +38,9 @@ public function render(): array $result = $this->initializeResultArray(); // Show warning only when editing existing records. if ($this->data['command'] !== 'new') { - // Load localization file. - Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf'); // Create flash message. Helper::addMessage( - htmlspecialchars(Helper::getLanguageService()->getLL('flash.editInProductionWarning')), + htmlspecialchars(Helper::getLanguageService()->sL('LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:flash.editInProductionWarning')), '', // We must not set a title/header, because

isn't allowed in FieldInformation. ContextualFeedbackSeverity::WARNING ); diff --git a/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php b/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php index 546d4610c9..330f65d1fe 100644 --- a/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php +++ b/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php @@ -28,6 +28,8 @@ */ class SolrCoreStatus extends AbstractNode { + const LANG_PREFIX = 'LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:'; + /** * Shows Solr core status for given 'index_name' * @@ -49,8 +51,6 @@ public function render(): array // Show only when editing existing records. if ($this->data['command'] !== 'new') { $core = $this->data['databaseRow']['index_name']; - // Load localization file. - Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf'); // Get Solr instance. $solr = Solr::getInstance($core); if ($solr->ready) { @@ -64,14 +64,14 @@ public function render(): array $uptimeInSeconds = floor($response->getUptime() / 1000); $dateTimeFrom = new \DateTime('@0'); $dateTimeTo = new \DateTime("@$uptimeInSeconds"); - $uptime = $dateTimeFrom->diff($dateTimeTo)->format('%a ' . Helper::getLanguageService()->getLL('flash.days') . ', %H:%I:%S'); + $uptime = $dateTimeFrom->diff($dateTimeTo)->format('%a ' . Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.days') . ', %H:%I:%S'); $numDocuments = $response->getNumberOfDocuments(); $startTime = $response->getStartTime() ? $dateFormatter->format($response->getStartTime()) : 'N/A'; $lastModified = $response->getLastModified() ? $dateFormatter->format($response->getLastModified()) : 'N/A'; // Create flash message. Helper::addMessage( - sprintf(Helper::getLanguageService()->getLL('flash.coreStatus'), $startTime, $uptime, $lastModified, $numDocuments), + sprintf(Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.coreStatus'), $startTime, $uptime, $lastModified, $numDocuments), '', // We must not set a title/header, because

isn't allowed in FieldInformation. ContextualFeedbackSeverity::INFO ); @@ -79,7 +79,7 @@ public function render(): array } else { // Could not fetch core status. Helper::addMessage( - Helper::getLanguageService()->getLL('solr.error'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'solr.error'), '', // We must not set a title/header, because

isn't allowed in FieldInformation. ContextualFeedbackSeverity::ERROR ); diff --git a/Classes/Task/BaseAdditionalFieldProvider.php b/Classes/Task/BaseAdditionalFieldProvider.php index 1cfc0b35ad..b210e5e42c 100644 --- a/Classes/Task/BaseAdditionalFieldProvider.php +++ b/Classes/Task/BaseAdditionalFieldProvider.php @@ -31,6 +31,8 @@ */ class BaseAdditionalFieldProvider implements AdditionalFieldProviderInterface { + const LANG_PREFIX = 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:'; + /** * Gets additional fields to render in the form to add/edit a task * @@ -55,14 +57,12 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC { $fieldsValid = true; - Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_tasks.xlf'); - - $messageTitle = Helper::getLanguageService()->getLL('additionalFields.error'); + $messageTitle = Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.error'); $messageSeverity = ContextualFeedbackSeverity::ERROR; if (isset($submittedData['doc']) && empty($submittedData['doc'])) { Helper::addMessage( - Helper::getLanguageService()->getLL('additionalFields.doc') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.doc') . ' ' . Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.valid'), $messageTitle, $messageSeverity, true, @@ -73,7 +73,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC if ((isset($submittedData['pid']) && (int) $submittedData['pid'] <= 0)) { Helper::addMessage( - Helper::getLanguageService()->getLL('additionalFields.pid') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.pid') . ' ' . Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.valid'), $messageTitle, $messageSeverity, true, @@ -84,7 +84,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC if (!isset($submittedData['commit']) && !isset($submittedData['optimize']) && !isset($submittedData['pid']) && ($submittedData['class'] != 'Kitodo\Dlf\Task\SuggestBuildTask')) { Helper::addMessage( - Helper::getLanguageService()->getLL('additionalFields.commitOrOptimize'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.commitOrOptimize'), $messageTitle, $messageSeverity, true, @@ -94,13 +94,13 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC } if (!$submittedData['uid']) { - $messageTitle = Helper::getLanguageService()->getLL('additionalFields.warning'); + $messageTitle = Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.warning'); $messageSeverity = ContextualFeedbackSeverity::WARNING; } if ((isset($submittedData['lib']) && (int) $submittedData['lib'] <= 0)) { Helper::addMessage( - Helper::getLanguageService()->getLL('additionalFields.lib') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.lib') . ' ' . Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.valid'), $messageTitle, $messageSeverity, true, @@ -111,7 +111,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC if ((isset($submittedData['solr']) && (int) $submittedData['solr'] <= 0) || !isset($submittedData['solr'])) { Helper::addMessage( - Helper::getLanguageService()->getLL('additionalFields.solr') . ' ' . Helper::getLanguageService()->getLL('additionalFields.valid'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.solr') . ' ' . Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.valid'), $messageTitle, $messageSeverity, true, @@ -123,7 +123,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC if (((isset($submittedData['coll']) && isset($submittedData['all'])) || (!isset($submittedData['coll']) && !isset($submittedData['all']))) && !isset($submittedData['doc']) && !isset($submittedData['lib']) && isset($submittedData['pid'])) { Helper::addMessage( - Helper::getLanguageService()->getLL('additionalFields.collOrAll'), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'additionalFields.collOrAll'), $messageTitle, $messageSeverity, true, diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index f7441d5ada..e70d608f69 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -19,7 +19,7 @@ $flexFormsPathPrefix = 'FILE:EXT:dlf/Configuration/FlexForms/'; $iconsDirectory = 'EXT:dlf/Resources/Public/Icons/'; -$pluginsLabel = 'EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.'; +$pluginsLabel = 'LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.'; // Plugin "annotation". \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( From 094b287c7ec0bcd7e19bc54a55ed3da087afd5fa Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 16:07:36 +0200 Subject: [PATCH 024/111] Update parameter type to ContextualFeedbackSeverity for Typo3 v13 support. --- Classes/Common/Indexer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 191bcd1a1a..4e2182db0b 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -774,11 +774,11 @@ private static function addErrorMessage(string $message): void * * @param string $message * @param string $type - * @param int $status + * @param ContextualFeedbackSeverity $severity * * @return void */ - private static function addMessage(string $message, string $type, int $status): void + private static function addMessage(string $message, string $type, ContextualFeedbackSeverity $severity): void { Helper::addMessage( $message, From b7ef5d540dfd0d1f2ffcc48dcdbe6748e4dc8cd1 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 16:09:04 +0200 Subject: [PATCH 025/111] Fix validation form translation. --- Configuration/TCA/Overrides/tt_content.php | 2 +- Configuration/TsConfig/ContentElements.tsconfig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index f7441d5ada..d87d4547de 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -132,7 +132,7 @@ \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'Dlf', 'ValidationForm', - $pluginsLabel . 'validation.title', + $pluginsLabel . 'validationform.title', $iconsDirectory . 'tx-dlf-validationform.svg' ); diff --git a/Configuration/TsConfig/ContentElements.tsconfig b/Configuration/TsConfig/ContentElements.tsconfig index f355c537bd..a53cd43297 100644 --- a/Configuration/TsConfig/ContentElements.tsconfig +++ b/Configuration/TsConfig/ContentElements.tsconfig @@ -157,8 +157,8 @@ mod.wizards.newContentElement.wizardItems { } tx_dlf_validationform { iconIdentifier = tx-dlf-validationform - title = LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.validation.title - description = LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.validation.description + title = LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.validationform.title + description = LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.validationform.description tt_content_defValues { CType = list list_type = dlf_validationform From 3814f8757824260c4e94ee4c0a437e2293269a4a Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 9 Aug 2025 16:12:14 +0200 Subject: [PATCH 026/111] Add padding around error page of New Tenant Module. --- Resources/Private/Templates/Backend/NewTenant/Error.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Resources/Private/Templates/Backend/NewTenant/Error.html b/Resources/Private/Templates/Backend/NewTenant/Error.html index e0ad43b404..21c1301847 100644 --- a/Resources/Private/Templates/Backend/NewTenant/Error.html +++ b/Resources/Private/Templates/Backend/NewTenant/Error.html @@ -12,8 +12,9 @@ -

- - +
+

+ +
From 500addab923ebe931e4b08c53502eb2313fed787 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 12 Aug 2025 17:13:25 +0200 Subject: [PATCH 027/111] Remove workaround to disable "json_response" framework extension which doesn't work in Typo3 testing framework v8+. --- Tests/Functional/Api/OaiPmhTest.php | 65 ++++------ Tests/Functional/Api/OaiPmhTypo3Client.php | 114 ++++++++++++++++++ .../Api/PageViewProxyDisabledTest.php | 11 +- Tests/Functional/Api/PageViewProxyTest.php | 9 +- Tests/Functional/FunctionalTestCase.php | 37 +++--- 5 files changed, 160 insertions(+), 76 deletions(-) create mode 100644 Tests/Functional/Api/OaiPmhTypo3Client.php diff --git a/Tests/Functional/Api/OaiPmhTest.php b/Tests/Functional/Api/OaiPmhTest.php index 00a11a0b96..9e43756d37 100644 --- a/Tests/Functional/Api/OaiPmhTest.php +++ b/Tests/Functional/Api/OaiPmhTest.php @@ -13,18 +13,16 @@ namespace Kitodo\Dlf\Tests\Functional\Api; use DateTime; -use GuzzleHttp\Client as HttpClient; use Kitodo\Dlf\Common\Solr\Solr; use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; +use Kitodo\Dlf\Tests\Functional\Api\OaiPmhTypo3Client; use Phpoaipmh\Endpoint; use Phpoaipmh\Exception\OaipmhException; -use SimpleXMLElement; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; class OaiPmhTest extends FunctionalTestCase { - protected bool $disableJsonWrappedResponse = true; - protected array $coreExtensionsToLoad = [ 'fluid', 'fluid_styled_content', @@ -103,14 +101,8 @@ protected function setUpOaiSolr(): void */ public function correctlyRespondsOnBadVerb() { - $client = new HttpClient(); - $response = $client->get($this->baseUrl, [ - 'query' => [ - 'id' => $this->oaiPage, - 'verb' => 'nastyVerb', - ], - ]); - $xml = new SimpleXMLElement((string) $response->getBody()); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this, false); + $xml = $client->request('nastyVerb'); self::assertEquals('badVerb', (string) $xml->error['code']); @@ -129,8 +121,8 @@ public function correctlyRespondsOnBadVerb() */ public function canIdentify() { - $oai = Endpoint::build($this->oaiUrl); - $identity = $oai->identify(); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); + $identity = (new Endpoint($client))->identify(); self::assertEquals('Identify', (string) $identity->request['verb']); self::assertEquals('Default Library - OAI Repository', (string) $identity->Identify->repositoryName); @@ -143,8 +135,8 @@ public function canIdentify() */ public function identifyGivesFallbackDatestampWhenNoDocuments() { - $oai = Endpoint::build($this->oaiUrlNoStoragePid); - $identity = $oai->identify(); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPageNoStoragePid, $this); + $identity = (new Endpoint($client))->identify(); self::assertUtcDateString((string) $identity->Identify->earliestDatestamp); } @@ -154,8 +146,8 @@ public function identifyGivesFallbackDatestampWhenNoDocuments() */ public function canListMetadataFormats() { - $oai = Endpoint::build($this->oaiUrl); - $formats = $oai->listMetadataFormats(); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); + $formats = (new Endpoint($client))->listMetadataFormats(); $formatMap = []; foreach ($formats as $format) { @@ -170,8 +162,8 @@ public function canListMetadataFormats() */ public function canListRecords() { - $oai = Endpoint::build($this->oaiUrl); - $result = $oai->listRecords('mets'); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); + $result = (new Endpoint($client))->listRecords('mets'); $record = $result->current(); $metsRoot = $record->metadata->children('http://www.loc.gov/METS/')[0]; @@ -187,8 +179,8 @@ public function noRecordsUntil1900() $this->expectException(OaipmhException::class); $this->expectExceptionMessage('empty list'); - $oai = Endpoint::build($this->oaiUrl); - $result = $oai->listRecords('mets', null, (new DateTime())->setDate(1900, 1, 1)); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); + $result = (new Endpoint($client))->listRecords('mets', null, (new DateTime())->setDate(1900, 1, 1)); $result->current(); } @@ -201,19 +193,14 @@ public function canUseResumptionToken() // NOTE: cursor and expirationDate are optional by the specification, // but we include them in our implementation - $client = new HttpClient(); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); // The general handling of resumption tokens should be the same for these verbs foreach (['ListIdentifiers', 'ListRecords'] as $verb) { // Check that we get a proper resumption token when starting a list - $response = $client->get($this->baseUrl, [ - 'query' => [ - 'id' => $this->oaiPage, - 'verb' => $verb, + $xml = $client->request($verb, [ 'metadataPrefix' => 'mets', - ], ]); - $xml = new SimpleXMLElement((string) $response->getBody()); $resumptionToken = $xml->$verb->resumptionToken; self::assertEquals('0', (string) $resumptionToken['cursor']); @@ -227,14 +214,9 @@ public function canUseResumptionToken() // Check that we can resume and get a proper cursor value $cursor = 1; do { - $response = $client->get($this->baseUrl, [ - 'query' => [ - 'id' => $this->oaiPage, - 'verb' => $verb, + $xml = $client->request($verb, [ 'resumptionToken' => (string) $resumptionToken, - ], ]); - $xml = new SimpleXMLElement((string) $response->getBody()); $resumptionToken = $xml->$verb->resumptionToken; $tokenStr = (string) $resumptionToken; @@ -257,18 +239,13 @@ public function canUseResumptionToken() */ public function noResumptionTokenForCompleteList() { - $client = new HttpClient(); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); foreach (['ListIdentifiers', 'ListRecords'] as $verb) { - $response = $client->get($this->baseUrl, [ - 'query' => [ - 'id' => $this->oaiPage, - 'verb' => $verb, + $xml = $client->request($verb, [ 'metadataPrefix' => 'mets', 'set' => 'collection-with-single-document', - ], ]); - $xml = new SimpleXMLElement((string) $response->getBody()); self::assertCount(1, $xml->$verb->children()); self::assertEmpty($xml->$verb->resumptionToken); @@ -280,8 +257,8 @@ public function noResumptionTokenForCompleteList() */ public function canListAndResumeIdentifiers() { - $oai = Endpoint::build($this->oaiUrl); - $result = $oai->listIdentifiers('mets'); + $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); + $result = (new Endpoint($client))->listIdentifiers('mets'); $record = $result->current(); self::assertEquals('oai:de:slub-dresden:db:id-476251419', $record->identifier); diff --git a/Tests/Functional/Api/OaiPmhTypo3Client.php b/Tests/Functional/Api/OaiPmhTypo3Client.php new file mode 100644 index 0000000000..34d073f806 --- /dev/null +++ b/Tests/Functional/Api/OaiPmhTypo3Client.php @@ -0,0 +1,114 @@ + + * + * This file is part of the Kitodo and TYPO3 projects. + * + * @license GNU General Public License version 3 or later. + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + */ + +namespace Kitodo\Dlf\Tests\Functional\Api; + +use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; +use Phpoaipmh\ClientInterface; +use Phpoaipmh\Exception\OaipmhException; +use Phpoaipmh\Exception\MalformedResponseException; +use SimpleXMLElement; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; + + +/** + * Custom implementation of Phpoaipmh\ClientInterface such that Phpoaipmh\Endpoint can be used + * to test the Typo3 OAI endpoint. + * + * See: https://github.com/caseyamcl/phpoaipmh/blob/master/src/ClientInterface.php + */ +class OaiPmhTypo3Client implements ClientInterface +{ + + /** + * The base url of the Typo3 server used for functional tests + */ + private string $baseUrl; + + /** + * The Typo3 page id of the OAI endpoint + */ + private int $pageId; + + /** + * A reference to the functional test case class such that internal Typo3 requests can be issued. + */ + private FunctionalTestCase $functionalTestCase; + + /** + * Whether to throw an OaipmhException if the OAI response contains error information. + */ + private bool $throwError; + + /** + * Initialize a OaiPmh client. + * + * @param string $baseUrl the base url of the Typo3 server used for functional tests + * @param int $pageId the Typo3 page id of the OAI endpoint + * @param FunctionalTestCase $funtionalTestCase reference to the functional test case in order to issue internal requests + * @param bool $throwError whether to throw an OaiPmhException if the OAI response contains error information + */ + public function __construct( + string $baseUrl, + int $pageId, + FunctionalTestCase $functionalTestCase, + bool $throwError = true + ) + { + $this->baseUrl = $baseUrl; + $this->pageId = $pageId; + $this->functionalTestCase = $functionalTestCase; + $this->throwError = $throwError; + } + + /** + * Issue a OaiPmh request for a given verb and options. + * + * @param $verb the verb as string + * @param array $params additional options + * @return SimpleXMLElement the parsed response as XML element + */ + public function request($verb, array $params = array()) { + $request = (new InternalRequest($this->baseUrl))->withQueryParameters( + array_merge([ + 'id' => $this->pageId, + 'verb' => $verb, + ], $params) + ); + + $response = $this->functionalTestCase->executeInternalRequest($request); + + try { + $xml = new SimpleXMLElement((string) $response->getBody()); + } catch (Exception $e) { + throw new MalformedResponseException(sprintf("Could not decode XML Response: %s", $e->getMessage())); + } + + if ($this->throwError && isset($xml->error)) { + $code = (string) $xml->error['code']; + $msg = (string) $xml->error; + + throw new OaipmhException($code, $msg); + } + + return $xml; + } + + /** + * Empty implementation + */ + public function getHttpAdapter() + { + return null; + } + +} \ No newline at end of file diff --git a/Tests/Functional/Api/PageViewProxyDisabledTest.php b/Tests/Functional/Api/PageViewProxyDisabledTest.php index bce00df4e9..3f2c42fd77 100644 --- a/Tests/Functional/Api/PageViewProxyDisabledTest.php +++ b/Tests/Functional/Api/PageViewProxyDisabledTest.php @@ -15,11 +15,10 @@ use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; class PageViewProxyDisabledTest extends FunctionalTestCase { - protected bool $disableJsonWrappedResponse = true; - /** * Query the page view proxy with the given parameters. * @@ -34,11 +33,11 @@ class PageViewProxyDisabledTest extends FunctionalTestCase */ protected function queryProxy(array $query, string $method = 'GET'): ResponseInterface { - $query['eID'] = 'tx_dlf_pageview_proxy'; + $request = (new InternalRequest($this->baseUrl))->withQueryParameters(array_merge([ + 'eID' => 'tx_dlf_pageview_proxy', + ], $query))->withMethod($method); - return $this->httpClient->request($method, '', [ - 'query' => $query, - ]); + return $this->executeInternalRequest($request); } /** diff --git a/Tests/Functional/Api/PageViewProxyTest.php b/Tests/Functional/Api/PageViewProxyTest.php index 07de469330..dec89f1990 100644 --- a/Tests/Functional/Api/PageViewProxyTest.php +++ b/Tests/Functional/Api/PageViewProxyTest.php @@ -15,6 +15,7 @@ use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; class PageViewProxyTest extends FunctionalTestCase { @@ -55,11 +56,11 @@ protected function getDlfConfiguration(): array */ protected function queryProxy(array $query, string $method = 'GET'): ResponseInterface { - $query['eID'] = 'tx_dlf_pageview_proxy'; + $request = (new InternalRequest($this->baseUrl))->withQueryParameters(array_merge([ + 'eID' => 'tx_dlf_pageview_proxy', + ], $query))->withMethod($method); - return $this->httpClient->request($method, '', [ - 'query' => $query, - ]); + return $this->executeInternalRequest($request); } /** diff --git a/Tests/Functional/FunctionalTestCase.php b/Tests/Functional/FunctionalTestCase.php index 28c85f99c2..8eb3a620d2 100644 --- a/Tests/Functional/FunctionalTestCase.php +++ b/Tests/Functional/FunctionalTestCase.php @@ -16,6 +16,7 @@ use GuzzleHttp\Client as HttpClient; use Kitodo\Dlf\Common\Solr\Solr; use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; +use Psr\Http\Message\ResponseInterface; use Symfony\Component\Yaml\Yaml; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -23,6 +24,7 @@ use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; use TYPO3\CMS\Extbase\Persistence\Repository; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; +use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; /** * Base class for functional test cases. This provides some common configuration @@ -66,15 +68,6 @@ class FunctionalTestCase extends \TYPO3\TestingFramework\Core\Functional\Functio ], ]; - /** - * By default, the testing framework wraps responses into a JSON object - * that contains status code etc. as fields. Set this field to true to avoid - * this behavior by not loading the json_response extension. - * - * @var bool - */ - protected bool $disableJsonWrappedResponse = false; - /** * @var PersistenceManager */ @@ -92,19 +85,6 @@ class FunctionalTestCase extends \TYPO3\TestingFramework\Core\Functional\Functio protected SolrCoreRepository $solrCoreRepository; - public function __construct() - { - parent::__construct(); - - $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); - - if ($this->disableJsonWrappedResponse) { - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { - return $ext !== 'Resources/Core/Functional/Extensions/json_response'; - }); - } - } - /** * Sets up the test case environment. * @@ -116,6 +96,8 @@ public function __construct() */ public function setUp(): void { + $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); + parent::setUp(); $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); @@ -384,4 +366,15 @@ protected static function assertArrayMatches(array $sub, array $super, string $m { self::assertEquals($sub, ArrayUtility::intersectRecursive($super, $sub), $message); } + + /** + * Execute an internal Typo3 Http request and return its response. + * + * @param InternalRequest $request the request + * @return ResponseInterface the response + */ + public function executeInternalRequest(InternalRequest $request): ResponseInterface + { + return $this->executeFrontendSubRequest($request); + } } From 92fa132d0ef08a0412aab5ff4ee80b8d90471dd5 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 13:41:33 +0200 Subject: [PATCH 028/111] Update test fixtures for Typo3 v13 update. --- Tests/Fixtures/Common/pages.csv | 8 +- Tests/Fixtures/Common/pages.xml | 126 ------ Tests/Fixtures/OaiPmh/pages.csv | 14 + Tests/Fixtures/OaiPmh/pages.xml | 374 ------------------ Tests/Functional/Api/OaiPmhTest.php | 2 +- .../Repository/DocumentRepositoryTest.php | 2 +- 6 files changed, 20 insertions(+), 506 deletions(-) delete mode 100644 Tests/Fixtures/Common/pages.xml create mode 100644 Tests/Fixtures/OaiPmh/pages.csv delete mode 100644 Tests/Fixtures/OaiPmh/pages.xml diff --git a/Tests/Fixtures/Common/pages.csv b/Tests/Fixtures/Common/pages.csv index be9073b4e7..cb5aadfdd0 100644 --- a/Tests/Fixtures/Common/pages.csv +++ b/Tests/Fixtures/Common/pages.csv @@ -1,4 +1,4 @@ -pages,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,uid,pid,tstamp,crdate,deleted,hidden,starttime,endtime,fe_group,sorting,rowDescription,editlock,sys_language_uid,l10n_parent,l10n_source,t3_origuid,l10n_diffsource,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,title,slug,doktype,TSconfig,is_siteroot,php_tree_stop,url,shortcut,shortcut_mode,subtitle,layout,target,media,lastUpdated,keywords,cache_timeout,cache_tags,newUntil,description,no_search,SYS_LASTCHANGED,abstract,module,extendToSubpages,author,author_email,nav_title,nav_hide,content_from_pid,mount_pid,mount_pid_ol,l18n_cfg,backend_layout,backend_layout_next_level,tsconfig_includes,categories -,19999,0,1644840191,1644840051,0,0,0,0,,764,,0,0,0,0,0,a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;},1,0,31,27,0,DLF Testing Site,,254,,1,0,,0,0,,0,,0,0,,0,,0,,0,1644840191,,,0,,,,0,0,0,0,0,,,,0 -,20000,19999,1644840191,1644840051,0,0,0,0,,764,,0,0,0,0,0,a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;},1,0,31,27,0,Data,/data,254,,0,0,,0,0,,0,,0,0,,0,,0,,0,1644840191,,,0,,,,0,0,0,0,0,,,,0 +pages,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,uid,pid,tstamp,crdate,deleted,hidden,starttime,endtime,fe_group,sorting,rowDescription,editlock,sys_language_uid,l10n_parent,l10n_source,l10n_diffsource,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,title,slug,doktype,TSconfig,is_siteroot,php_tree_stop,url,shortcut,shortcut_mode,subtitle,layout,target,media,lastUpdated,keywords,cache_timeout,cache_tags,newUntil,description,no_search,SYS_LASTCHANGED,abstract,module,extendToSubpages,author,author_email,nav_title,nav_hide,content_from_pid,mount_pid,mount_pid_ol,l18n_cfg,backend_layout,backend_layout_next_level,tsconfig_includes,categories +,19999,0,1644840191,1644840051,0,0,0,0,,764,,0,0,0,0,a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;},1,0,31,27,0,DLF Testing Site,,254,,1,0,,0,0,,0,,0,0,,0,,0,,0,1644840191,,,0,,,,0,0,0,0,0,,,,0 +,20000,19999,1644840191,1644840051,0,0,0,0,,764,,0,0,0,0,a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;},1,0,31,27,0,Data,/data,254,,0,0,,0,0,,0,,0,0,,0,,0,,0,1644840191,,,0,,,,0,0,0,0,0,,,,0 diff --git a/Tests/Fixtures/Common/pages.xml b/Tests/Fixtures/Common/pages.xml deleted file mode 100644 index 571d0928c1..0000000000 --- a/Tests/Fixtures/Common/pages.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - 19999 - 0 - 1644840191 - 1644840051 - 0 - 0 - 0 - 0 - - 764 - - 0 - 0 - 0 - 0 - 0 - a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;} - 1 - 0 - 31 - 27 - 0 - DLF Testing Site - / - 254 - - 1 - 0 - - 0 - 0 - - 0 - - 0 - 0 - - 0 - - 0 - - 0 - 1644840191 - - - 0 - - - - 0 - 0 - 0 - 0 - 0 - - - - 0 - - - - - 20000 - 19999 - 1644840191 - 1644840051 - 0 - 0 - 0 - 0 - - 764 - - 0 - 0 - 0 - 0 - 0 - a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;} - 1 - 0 - 31 - 27 - 0 - Data - /data - 254 - - 0 - 0 - - 0 - 0 - - 0 - - 0 - 0 - - 0 - - 0 - - 0 - 1644840191 - - - 0 - - - - 0 - 0 - 0 - 0 - 0 - - - - 0 - - diff --git a/Tests/Fixtures/OaiPmh/pages.csv b/Tests/Fixtures/OaiPmh/pages.csv new file mode 100644 index 0000000000..dbbb480e21 --- /dev/null +++ b/Tests/Fixtures/OaiPmh/pages.csv @@ -0,0 +1,14 @@ +pages,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,uid,pid,tstamp,crdate,deleted,hidden,starttime,endtime,fe_group,sorting,rowDescription,editlock,sys_language_uid,l10n_parent,l10n_source,l10n_diffsource,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,title,slug,doktype,TSconfig,is_siteroot,php_tree_stop,url,shortcut,shortcut_mode,subtitle,layout,target,media,lastUpdated,keywords,cache_timeout,cache_tags,newUntil,description,no_search,SYS_LASTCHANGED,abstract,module,extendToSubpages,author,author_email,nav_title,nav_hide,content_from_pid,mount_pid,mount_pid_ol,l18n_cfg,backend_layout,backend_layout_next_level,tsconfig_includes,categories,,,,,, +,20001,19999,1644840191,1644840051,0,0,0,0,,764,,0,0,0,0,a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;},1,0,31,27,0,OAI,/oai,1,,0,0,,0,0,,0,,0,0,,0,,0,,0,1644840191,,,0,,,,0,0,0,0,0,,,,0,,,,,, +,20002,19999,1644840191,1644840051,0,0,0,0,,764,,0,0,0,0,a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;},1,0,31,27,0,OAI,/oai,1,,0,0,,0,0,,0,,0,0,,0,,0,,0,1644840191,,,0,,,,0,0,0,0,0,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +sys_template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,uid,pid,tstamp,crdate,deleted,hidden,starttime,endtime,sorting,description,title,root,clear,include_static_file,constants,config,basedOn,includeStaticAfterBasedOn,static_file_mode,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,21001,20001,1644856416,1644856388,0,0,0,0,256,,OAI-PMH Template,1,3,"EXT:fluid_styled_content/Configuration/TypoScript/,EXT:dlf/Configuration/TypoScript/Plugins/OaiPmh/,EXT:dlf/Configuration/TypoScript/",plugin.tx_dlf.persistence.storagePid = 20000,,,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,21002,20002,1644856416,1644856388,0,0,0,0,256,,OAI-PMH Template (missing storagePid),1,3,"EXT:fluid_styled_content/Configuration/TypoScript/,EXT:dlf/Configuration/TypoScript/Plugins/OaiPmh/,EXT:dlf/Configuration/TypoScript/",,,,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +tt_content,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,uid,rowDescription,pid,tstamp,crdate,deleted,hidden,starttime,endtime,fe_group,sorting,editlock,sys_language_uid,l18n_parent,l10n_source,l18n_diffsource,CType,header,header_position,bodytext,bullets_type,uploads_description,uploads_type,assets,image,imagewidth,imageorient,imagecols,imageborder,media,layout,frame_class,cols,space_before_class,space_after_class,records,pages,colPos,subheader,header_link,image_zoom,header_layout,list_type,sectionIndex,linkToTop,file_collections,filelink_size,filelink_sorting,filelink_sorting_direction,target,date,recursive,imageheight,pi_flexform,selected_categories,category_field,table_class,table_caption,table_delimiter,table_enclosure,table_header_position,table_tfoot,categories +,22001,,20001,1644840071,1644840071,0,0,0,0,,256,0,0,0,0,,list,,,,0,0,0,0,0,0,25,1,0,0,0,default,0,,,,,0,,,1,0,dlf_oaipmh,1,0,,0,,,,0,0,0," 10001 1 1800 0 11001 50000 ",,,,,124,0,0,0,0 +,22002,,20002,1644840071,1644840071,0,0,0,0,,256,0,0,0,0,,list,,,,0,0,0,0,0,0,25,1,0,0,0,default,0,,,,,0,,,1,0,dlf_oaipmh,1,0,,0,,,,0,0,0," 10001 1 1800 0 11001 50000 ",,,,,124,0,0,0,0 diff --git a/Tests/Fixtures/OaiPmh/pages.xml b/Tests/Fixtures/OaiPmh/pages.xml deleted file mode 100644 index ff5d1661da..0000000000 --- a/Tests/Fixtures/OaiPmh/pages.xml +++ /dev/null @@ -1,374 +0,0 @@ - - - - - 20001 - 19999 - 1644840191 - 1644840051 - 0 - 0 - 0 - 0 - - 764 - - 0 - 0 - 0 - 0 - 0 - a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;} - 1 - 0 - 31 - 27 - 0 - OAI - /oai - 1 - - 0 - 0 - - 0 - 0 - - 0 - - 0 - 0 - - 0 - - 0 - - 0 - 1644840191 - - - 0 - - - - 0 - 0 - 0 - 0 - 0 - - - - 0 - - - - 21001 - 20001 - 1644856416 - 1644856388 - 0 - 0 - 0 - 0 - 256 - - 0 - OAI-PMH Template - 1 - 3 - EXT:fluid_styled_content/Configuration/TypoScript/,EXT:dlf/Configuration/TypoScript/Plugins/OaiPmh/,EXT:dlf/Configuration/TypoScript/ - plugin.tx_dlf.persistence.storagePid = 20000 - - - 0 - 0 - - - - 22001 - - 20001 - 1644840071 - 1644840071 - 0 - 0 - 0 - 0 - - 256 - 0 - 0 - 0 - 0 - 0 - - list -
- - - 0 - 0 - 0 - 0 - 0 - 0 - 25 - 1 - 0 - 0 - 0 - default - 0 - - - - - 0 - - - 1 - 0 - dlf_oaipmh - 1 - 0 - - 0 - - - - 0 - 0 - 0 - - - - - - - 10001 - - - 1 - - - 1800 - - - 0 - - - 11001 - - - 50000 - - - - - - - - - ]]> - - 0 - - - - - - 124 - 0 - 0 - 0 - 0 -
- - - - 20002 - 19999 - 1644840191 - 1644840051 - 0 - 0 - 0 - 0 - - 764 - - 0 - 0 - 0 - 0 - 0 - a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;} - 1 - 0 - 31 - 27 - 0 - OAI - /oai - 1 - - 0 - 0 - - 0 - 0 - - 0 - - 0 - 0 - - 0 - - 0 - - 0 - 1644840191 - - - 0 - - - - 0 - 0 - 0 - 0 - 0 - - - - 0 - - - - 21002 - 20002 - 1644856416 - 1644856388 - 0 - 0 - 0 - 0 - 256 - - 0 - OAI-PMH Template (missing storagePid) - 1 - 3 - EXT:fluid_styled_content/Configuration/TypoScript/,EXT:dlf/Configuration/TypoScript/Plugins/OaiPmh/,EXT:dlf/Configuration/TypoScript/ - - - - 0 - 0 - - - - 22002 - - 20002 - 1644840071 - 1644840071 - 0 - 0 - 0 - 0 - - 256 - 0 - 0 - 0 - 0 - 0 - - list -
- - - 0 - 0 - 0 - 0 - 0 - 0 - 25 - 1 - 0 - 0 - 0 - default - 0 - - - - - 0 - - - 1 - 0 - dlf_oaipmh - 1 - 0 - - 0 - - - - 0 - 0 - 0 - - - - - - - 10001 - - - 1 - - - 1800 - - - 0 - - - 11001 - - - 50000 - - - - - - - - - ]]> - - 0 - - - - - - 124 - 0 - 0 - 0 - 0 -
-
diff --git a/Tests/Functional/Api/OaiPmhTest.php b/Tests/Functional/Api/OaiPmhTest.php index 9e43756d37..c67b51ed49 100644 --- a/Tests/Functional/Api/OaiPmhTest.php +++ b/Tests/Functional/Api/OaiPmhTest.php @@ -60,7 +60,7 @@ public function setUp(): void $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/metadata.csv'); $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/libraries.csv'); $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/pages.csv'); - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.xml'); + $this->importCSVDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.csv'); $this->importCSVDataSet(__DIR__ . '/../../Fixtures/OaiPmh/solrcores.csv'); $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); diff --git a/Tests/Functional/Repository/DocumentRepositoryTest.php b/Tests/Functional/Repository/DocumentRepositoryTest.php index ea86519d5c..7497314f67 100644 --- a/Tests/Functional/Repository/DocumentRepositoryTest.php +++ b/Tests/Functional/Repository/DocumentRepositoryTest.php @@ -39,7 +39,7 @@ public function setUp(): void $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000); $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.csv'); - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml'); + $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/pages.csv'); $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/libraries.csv'); } From 7414183205d2b6628f961a141387d10d98dc39f6 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 13:42:17 +0200 Subject: [PATCH 029/111] Remove unused bool reference to disable json_request framework extension for Typo3 v13 update. --- Tests/Functional/Api/PageViewProxyTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/Functional/Api/PageViewProxyTest.php b/Tests/Functional/Api/PageViewProxyTest.php index dec89f1990..91857fd74a 100644 --- a/Tests/Functional/Api/PageViewProxyTest.php +++ b/Tests/Functional/Api/PageViewProxyTest.php @@ -19,8 +19,6 @@ class PageViewProxyTest extends FunctionalTestCase { - protected bool $disableJsonWrappedResponse = true; - /** * Returns the DLF configuration for the test instance. * From 1764015d50f827c4af00a1df71fa04aa76599eef Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 13:51:24 +0200 Subject: [PATCH 030/111] Fix deprecated call to GeneralUtility::_GP in OaiPmhController.php for Typo3 v13 update. --- Classes/Controller/OaiPmhController.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index 3af6283282..5a15fb50dc 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -19,6 +19,7 @@ use Kitodo\Dlf\Domain\Repository\LibraryRepository; use Kitodo\Dlf\Domain\Repository\TokenRepository; use Psr\Http\Message\ResponseInterface; +use TYPO3\CMS\Extbase\Mvc\RequestInterface; /** * Controller class for the plugin 'OAI-PMH Interface'. @@ -147,10 +148,11 @@ protected function deleteExpiredTokens() * Load URL parameters * * @access protected + * @param RequestInterface $request the HTTP request * * @return void */ - protected function getUrlParams() + protected function getUrlParams(RequestInterface $request) { $allowedParams = [ 'verb', @@ -165,9 +167,8 @@ protected function getUrlParams() $this->parameters = []; // Set only allowed parameters. foreach ($allowedParams as $param) { - // replace with $this->request->getQueryParams() when dropping support for Typo3 v11, see Deprecation-100596 - if (GeneralUtility::_GP($param)) { - $this->parameters[$param] = GeneralUtility::_GP($param); + if ($request->getQueryParams()[$param] ?? null) { + $this->parameters[$param] = $request->getQueryParams()[$param]; } } } @@ -271,7 +272,7 @@ protected function getMetsData(array $record) public function mainAction(): ResponseInterface { // Get allowed GET and POST variables. - $this->getUrlParams(); + $this->getUrlParams($this->request); // Delete expired resumption tokens. $this->deleteExpiredTokens(); From 1deec9d09975bed5ab8a13b8bb7b7768ea843348 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 14:19:32 +0200 Subject: [PATCH 031/111] Fix typing error in SolrSearchTest for Typo3 v13 update. --- Tests/Functional/Common/SolrSearchTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Functional/Common/SolrSearchTest.php b/Tests/Functional/Common/SolrSearchTest.php index b48bcb8e66..d851d6903f 100644 --- a/Tests/Functional/Common/SolrSearchTest.php +++ b/Tests/Functional/Common/SolrSearchTest.php @@ -60,21 +60,21 @@ public function canPrepareAndSubmit() self::assertCount(33, $resultSet); $params1 = ['query' => '*']; - $search = new SolrSearch($documentRepository, null, $settings, $params1); + $search = new SolrSearch($documentRepository, [], $settings, $params1); $search->prepare(); self::assertEquals(33, $search->getNumFound()); self::assertEquals(3, $search->getSolrResults()['numberOfToplevels']); self::assertCount(15, $search->getSolrResults()['documents']); $params2 = ['query' => '10 Keyboard pieces']; - $search2 = new SolrSearch($documentRepository, null, $settings, $params2); + $search2 = new SolrSearch($documentRepository, [], $settings, $params2); $search2->prepare(); self::assertEquals(1, $search2->getNumFound()); self::assertEquals(1, $search2->getSolrResults()['numberOfToplevels']); self::assertCount(1, $search2->getSolrResults()['documents']); $params3 = ['query' => 'foobar']; - $search3 = new SolrSearch($documentRepository, null, $settings, $params3); + $search3 = new SolrSearch($documentRepository, [], $settings, $params3); $search3->prepare(); self::assertEquals(0, $search3->getNumFound()); self::assertEquals(0, $search3->getSolrResults()['numberOfToplevels']); From 7e14b6d7b4bcbdd8b488ede2ea38b5a35910dad5 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 14:24:05 +0200 Subject: [PATCH 032/111] Fix spelling mistake in filename of MetadataRepositoryTest, preventing tests from getting executed. --- .../{MetatdataRepositoryTest.php => MetadataRepositoryTest.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tests/Functional/Repository/{MetatdataRepositoryTest.php => MetadataRepositoryTest.php} (100%) diff --git a/Tests/Functional/Repository/MetatdataRepositoryTest.php b/Tests/Functional/Repository/MetadataRepositoryTest.php similarity index 100% rename from Tests/Functional/Repository/MetatdataRepositoryTest.php rename to Tests/Functional/Repository/MetadataRepositoryTest.php From 011691d1a11a78e3bfd9bf4aa4d87d2f505cc34a Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 20:12:46 +0200 Subject: [PATCH 033/111] Fix ConfigurationManager::getContentObject was removed for Typo3 update. --- Classes/ViewHelpers/StdWrapViewHelper.php | 9 ++++++--- Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php | 10 ++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Classes/ViewHelpers/StdWrapViewHelper.php b/Classes/ViewHelpers/StdWrapViewHelper.php index 164b381993..9ca2600233 100644 --- a/Classes/ViewHelpers/StdWrapViewHelper.php +++ b/Classes/ViewHelpers/StdWrapViewHelper.php @@ -11,8 +11,8 @@ namespace Kitodo\Dlf\ViewHelpers; +use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; /** @@ -57,8 +57,11 @@ public function render(): string $wrap = $this->arguments['wrap']; $data = $this->arguments['data'] ?? []; - $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class); - $cObj = $configurationManager->getContentObject(); + if (!$this->renderingContext->hasAttribute(ServerRequestInterface::class)) { + throw new \RuntimeException('Required request not found in RenderingContext'); + } + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); + $cObj = $request->getAttribute('currentContentObject'); $insideContent = $this->renderChildren(); diff --git a/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php b/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php index 434cf0d0fe..882debedb7 100644 --- a/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php @@ -13,7 +13,10 @@ namespace Kitodo\Dlf\Tests\Unit\ViewHelpers; use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; +use TYPO3\CMS\Core\Http\ServerRequest; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; +use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; /** * @covers StdWrapViewHelper @@ -30,7 +33,14 @@ class StdWrapViewHelperTest extends FunctionalTestCase */ public function renderWithStdWrap(): void { + $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); + + $request = new ServerRequest(); + $request = $request->withAttribute("currentContentObject", $cObj); + $view = new StandaloneView(); + $view->setRequest($request); + $view->assign( 'metadataWrap', [ From 0abadf660d41fabe5c18201944c4bb0f23ac0e92 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 20:14:21 +0200 Subject: [PATCH 034/111] Fix MetadataWrapVariableViewHelper due to deprecated TypoScriptParser for Typo3 v13. --- .../MetadataWrapVariableViewHelper.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Classes/ViewHelpers/MetadataWrapVariableViewHelper.php b/Classes/ViewHelpers/MetadataWrapVariableViewHelper.php index ac7cadd413..7d4a795388 100644 --- a/Classes/ViewHelpers/MetadataWrapVariableViewHelper.php +++ b/Classes/ViewHelpers/MetadataWrapVariableViewHelper.php @@ -13,7 +13,9 @@ use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser; +use TYPO3\CMS\Core\EventDispatcher\NoopEventDispatcher; +use TYPO3\CMS\Core\TypoScript\AST\AstBuilder; +use TYPO3\CMS\Core\TypoScript\TypoScriptStringFactory; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -68,12 +70,13 @@ public static function renderStatic( RenderingContextInterface $renderingContext ): void { - $parser = GeneralUtility::makeInstance(TypoScriptParser::class); - $parser->parse($renderChildrenClosure()); + $factory = GeneralUtility::makeInstance(TypoScriptStringFactory::class); + $rootNode = $factory->parseFromString($renderChildrenClosure(), new AstBuilder(new NoopEventDispatcher())); + $setup = $rootNode->toArray(); $wrap = [ - 'key' => $parser->setup['key.'] ?? [], - 'value' => $parser->setup['value.'] ?? [], - 'all' => $parser->setup['all.'] ?? [], + 'key' => $setup['key.'] ?? [], + 'value' => $setup['value.'] ?? [], + 'all' => $setup['all.'] ?? [], ]; $renderingContext->getVariableProvider()->add($arguments['name'], $wrap); } From b9f64e4839752f7de8398442f761e972e24b1dba Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 20:24:06 +0200 Subject: [PATCH 035/111] Migrate phpunit configuration files via "phpunit --migrate-configuration". --- Build/Test/FunctionalTests.xml | 11 ++++------- Build/Test/UnitTests.xml | 10 ++++------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Build/Test/FunctionalTests.xml b/Build/Test/FunctionalTests.xml index 4e08bf0f23..157ad88860 100644 --- a/Build/Test/FunctionalTests.xml +++ b/Build/Test/FunctionalTests.xml @@ -1,23 +1,20 @@ + diff --git a/Build/Test/UnitTests.xml b/Build/Test/UnitTests.xml index e9811e4a58..f766379178 100644 --- a/Build/Test/UnitTests.xml +++ b/Build/Test/UnitTests.xml @@ -1,23 +1,21 @@ + From cc1dc1ca8b2774d0052b99cd107649a80d8def1b Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 13 Aug 2025 21:00:42 +0200 Subject: [PATCH 036/111] Fix StdWrapViewHelper for Typo3 v12. --- Classes/ViewHelpers/StdWrapViewHelper.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Classes/ViewHelpers/StdWrapViewHelper.php b/Classes/ViewHelpers/StdWrapViewHelper.php index 9ca2600233..0c8c6aa6a8 100644 --- a/Classes/ViewHelpers/StdWrapViewHelper.php +++ b/Classes/ViewHelpers/StdWrapViewHelper.php @@ -11,8 +11,6 @@ namespace Kitodo\Dlf\ViewHelpers; -use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; /** @@ -57,10 +55,10 @@ public function render(): string $wrap = $this->arguments['wrap']; $data = $this->arguments['data'] ?? []; - if (!$this->renderingContext->hasAttribute(ServerRequestInterface::class)) { + if (!$this->renderingContext->getRequest()) { throw new \RuntimeException('Required request not found in RenderingContext'); } - $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); + $request = $this->renderingContext->getRequest(); $cObj = $request->getAttribute('currentContentObject'); $insideContent = $this->renderChildren(); From 57dff89d9f3fbc1fab578fd29baeb91e735cbc9c Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 14:54:22 +0200 Subject: [PATCH 037/111] Remove outdated call to LanguageService::includeLLFile due to Typo3 v13 update. --- Classes/Common/Indexer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 4e2182db0b..99af1957ee 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -106,7 +106,6 @@ public static function add(Document $document, DocumentRepository $documentRepos return true; } elseif (self::solrConnect($document->getSolrcore(), $document->getPid())) { $success = true; - Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf'); // Handle multi-volume documents. $parentId = $document->getPartof(); if ($parentId) { From 795e0a48bad5807cbbc83189cbc944d0d06c31ec Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 14:58:28 +0200 Subject: [PATCH 038/111] Fix solr tests that failed due to reusing same solr index due to static variable in FunctionalTestCase for Typo3 v13 update. --- Tests/Functional/Common/SolrIndexingTest.php | 4 ---- Tests/Functional/Common/SolrSearchQueryTest.php | 1 - Tests/Functional/Common/SolrSearchTest.php | 4 +--- Tests/Functional/FunctionalTestCase.php | 14 +++++++------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Tests/Functional/Common/SolrIndexingTest.php b/Tests/Functional/Common/SolrIndexingTest.php index d1ac2bb1ad..db81190a51 100644 --- a/Tests/Functional/Common/SolrIndexingTest.php +++ b/Tests/Functional/Common/SolrIndexingTest.php @@ -20,7 +20,6 @@ use Kitodo\Dlf\Domain\Repository\DocumentRepository; use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; -use TYPO3\CMS\Core\Core\Bootstrap; use TYPO3\CMS\Core\Utility\GeneralUtility; class SolrIndexingTest extends FunctionalTestCase @@ -48,9 +47,6 @@ public function setUp(): void { parent::setUp(); - // Needed for Indexer::add, which uses the language service - Bootstrap::initializeLanguageObject(); - $this->collectionRepository = $this->initializeRepository(CollectionRepository::class, 20000); $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000); $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); diff --git a/Tests/Functional/Common/SolrSearchQueryTest.php b/Tests/Functional/Common/SolrSearchQueryTest.php index ecd2509d5b..4625cdfe07 100644 --- a/Tests/Functional/Common/SolrSearchQueryTest.php +++ b/Tests/Functional/Common/SolrSearchQueryTest.php @@ -48,7 +48,6 @@ public function setUp(): void } /** - * @test * @ignore */ public function canExecute() diff --git a/Tests/Functional/Common/SolrSearchTest.php b/Tests/Functional/Common/SolrSearchTest.php index d851d6903f..3fe2c54c03 100644 --- a/Tests/Functional/Common/SolrSearchTest.php +++ b/Tests/Functional/Common/SolrSearchTest.php @@ -28,8 +28,6 @@ class SolrSearchTest extends FunctionalTestCase __DIR__ . '/../../Fixtures/Common/documents_1.solr.json' ]; - private Solr $solr; - /** * Sets up the test environment. * @@ -44,7 +42,7 @@ public function setUp(): void { parent::setUp(); $this->setUpData(self::$databaseFixtures); - $this->solr = $this->setUpSolr(5, 0, self::$solrFixtures); + $this->setUpSolr(5, 0, self::$solrFixtures); } /** diff --git a/Tests/Functional/FunctionalTestCase.php b/Tests/Functional/FunctionalTestCase.php index 8eb3a620d2..b1a46fc528 100644 --- a/Tests/Functional/FunctionalTestCase.php +++ b/Tests/Functional/FunctionalTestCase.php @@ -85,6 +85,8 @@ class FunctionalTestCase extends \TYPO3\TestingFramework\Core\Functional\Functio protected SolrCoreRepository $solrCoreRepository; + protected ?Solr $solr = null; + /** * Sets up the test case environment. * @@ -328,21 +330,19 @@ protected function setUpSolr(int $uid, int $storagePid, array $solrFixtures): So $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); // Setup Solr only once for all tests in this suite - static $solr = null; - - if ($solr === null) { + if ($this->solr === null) { $coreName = Solr::createCore(); - $solr = Solr::getInstance($coreName); + $this->solr = Solr::getInstance($coreName); foreach ($solrFixtures as $filePath) { - $this->importSolrDocuments($solr, $filePath); + $this->importSolrDocuments($this->solr, $filePath); } } $coreModel = $this->solrCoreRepository->findByUid($uid); - $coreModel->setIndexName($solr->core); + $coreModel->setIndexName($this->solr->core); $this->solrCoreRepository->update($coreModel); $this->persistenceManager->persistAll(); - return $solr; + return $this->solr; } /** From 6e6a9b5df5220e26399ce3af79f3125501818f1e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 15:41:31 +0200 Subject: [PATCH 039/111] Add typo3/cms-install dependency due to reference to UpgradeWizardInterface. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 11081a9e7c..2dccb1ae8e 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ "ext-simplexml": "*", "typo3/cms-core": "^12.4|^13.4", "typo3/cms-extbase": "^12.4|^13.4", + "typo3/cms-install": "^12.4|^13.4", "typo3/cms-scheduler": "^12.4|^13.4", "typo3/cms-tstemplate": "^12.4|^13.4", "caseyamcl/phpoaipmh": "^3.3", From 3fbb80e78ad178d4ce0dab23ede090641c2ff8d8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 15:42:52 +0200 Subject: [PATCH 040/111] Ignore missing php extensions required by Typo3 when merely running phpstan. --- .github/workflows/phpstan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 54949d27a2..a5ab654c19 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies uses: php-actions/composer@v6 with: - command: update + command: update --ignore-platform-reqs - name: PHPStan Static Analysis uses: php-actions/phpstan@v3 From 17e0424e303cf4c9be8b27a9a3316ac0e5fbf36b Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 15:44:14 +0200 Subject: [PATCH 041/111] Update main README.md for Typo3 v12 and v13 support. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9435aeab11..6d6e25564b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ For a complete overview of all features, visit the [Kitodo homepage](https://www ## Requirements -Kitodo.Presentation requires [**TYPO3 v11**](https://get.typo3.org/version/11) or [**TYPO3 v12**](https://get.typo3.org/version/12). Additionally, [**Apache Solr v8.11 - v9.7**](https://solr.apache.org) with [**solr-ocrhighlighting v0.9.1+**](https://github.com/dbmdz/solr-ocrhighlighting/releases) are required as search engine backend. +Kitodo.Presentation requires [**TYPO3 v12**](https://get.typo3.org/version/12) or [**TYPO3 v13**](https://get.typo3.org/version/13). Additionally, [**Apache Solr v8.11 - v9.7**](https://solr.apache.org) with [**solr-ocrhighlighting v0.9.1+**](https://github.com/dbmdz/solr-ocrhighlighting/releases) are required as search engine backend. Application level dependencies are handled by [Composer](https://getcomposer.org) (see [composer.json](./composer.json)). From 34ddcba3c68f52cc1c27f6734d598caf09a4924c Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 15:46:09 +0200 Subject: [PATCH 042/111] Update Kitodo.Presentation package description for Typo3 v12 and v13 support and PHP 8.2 minimum requirement. --- ext_emconf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext_emconf.php b/ext_emconf.php index bee546beac..64723cf16d 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,8 +17,8 @@ 'category' => 'misc', 'constraints' => [ 'depends' => [ - 'php' => '8.1.0-8.4.99', - 'typo3' => '11.5.0-12.4.99' + 'php' => '8.2.0-8.4.99', + 'typo3' => '12.4.0-13.4.99' ], 'conflicts' => [], 'suggests' => [] From a3ff5b0699fd77e83e04e0783c5f5a9f02e8779a Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 15:50:40 +0200 Subject: [PATCH 043/111] Update GitHub test matrix for Typo3 v12 and v13 support against PHP 8.2 and 8.4. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b9d3e3cb86..f1893621b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - variants: [ {typo3: 11.5, php: 8.1}, {typo3: 12.4, php: 8.1}, {typo3: 11.5, php: 8.3}, {typo3: 12.4, php: 8.4} ] + variants: [ {typo3: 12.4, php: 8.2}, {typo3: 12.4, php: 8.4}, {typo3: 13.4, php: 8.2}, {typo3: 13.4, php: 8.4} ] steps: - name: Checkout code uses: actions/checkout@v4 From efc57a2781b19e3e0f43d57fe37e167a9335fee4 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 17:16:57 +0200 Subject: [PATCH 044/111] FIx useGroup check for fulltext files. Reduce logger severity to debug message. --- Classes/Common/MetsDocument.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Common/MetsDocument.php b/Classes/Common/MetsDocument.php index 21d25b6da7..1569f82ff5 100644 --- a/Classes/Common/MetsDocument.php +++ b/Classes/Common/MetsDocument.php @@ -1179,14 +1179,14 @@ public function getFullText(string $id): string if (!empty($physicalStructureNode)) { while ($useGroup = array_shift($useGroups)) { - if (in_array($useGroup, $physicalStructureNode['files'])) { + if (in_array($useGroup, array_keys($physicalStructureNode['files']))) { $fileLocations[$useGroup] = $this->getFileLocation($physicalStructureNode['files'][$useGroup]); } } } if (empty($fileLocations)) { - $this->logger->error('No file locations for fulltext @ID "' . $id . '"'); + $this->logger->debug('No file locations for fulltext @ID "' . $id . '"'); return $fullText; } From 41aa8150d49fabe8c0628c9c7d7c9c0ddf14aed8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 19:17:41 +0200 Subject: [PATCH 045/111] Reset index name cache when testing solr. Otherwise Index name cache causes solr tests to fail depending on executing order and whether a new php process is used to run a test. --- Classes/Common/Helper.php | 30 ++++++++++++++++---- Tests/Functional/Common/SolrIndexingTest.php | 2 ++ Tests/Functional/FunctionalTestCase.php | 2 ++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index 6d557ed50d..c684ace04f 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -77,6 +77,13 @@ class Helper */ protected static array $messages = []; + /** + * @access protected + * @static + * @var array A cache remembering which Solr core uid belongs to which index name + */ + protected static array $indexNameCache = []; + /** * Generates a flash message and adds it to a message queue. * @@ -445,8 +452,7 @@ public static function getIndexNameFromUid(int $uid, string $table, int $pid = - return $pid . '.' . $uid; }; - static $cache = []; - if (!isset($cache[$table])) { + if (!isset(self::$indexNameCache[$table])) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($table); @@ -459,17 +465,17 @@ public static function getIndexNameFromUid(int $uid, string $table, int $pid = - ->from($table) ->executeQuery(); - $cache[$table] = []; + self::$indexNameCache[$table] = []; while ($row = $result->fetchAssociative()) { - $cache[$table][$makeCacheKey($row['pid'], $row['uid'])] - = $cache[$table][$makeCacheKey(-1, $row['uid'])] + self::$indexNameCache[$table][$makeCacheKey($row['pid'], $row['uid'])] + = self::$indexNameCache[$table][$makeCacheKey(-1, $row['uid'])] = $row['index_name']; } } $cacheKey = $makeCacheKey($pid, $uid); - $result = $cache[$table][$cacheKey] ?? ''; + $result = self::$indexNameCache[$table][$cacheKey] ?? ''; if ($result === '') { self::warning('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"'); @@ -478,6 +484,18 @@ public static function getIndexNameFromUid(int $uid, string $table, int $pid = - return $result; } + /** + * Reset the index name cache. + * + * @access public + * + * @static + */ + public static function resetIndexNameCache() + { + self::$indexNameCache = []; + } + /** * Get language name from ISO code * diff --git a/Tests/Functional/Common/SolrIndexingTest.php b/Tests/Functional/Common/SolrIndexingTest.php index db81190a51..f24913c08d 100644 --- a/Tests/Functional/Common/SolrIndexingTest.php +++ b/Tests/Functional/Common/SolrIndexingTest.php @@ -13,6 +13,7 @@ namespace Kitodo\Dlf\Tests\Functional\Common; use Kitodo\Dlf\Common\AbstractDocument; +use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Indexer; use Kitodo\Dlf\Common\Solr\Solr; use Kitodo\Dlf\Domain\Model\SolrCore; @@ -190,6 +191,7 @@ public function canGetIndexFieldName() */ protected function createSolrCore(): object { + Helper::resetIndexNameCache(); $coreName = Solr::createCore(); $solr = Solr::getInstance($coreName); diff --git a/Tests/Functional/FunctionalTestCase.php b/Tests/Functional/FunctionalTestCase.php index b1a46fc528..159382822b 100644 --- a/Tests/Functional/FunctionalTestCase.php +++ b/Tests/Functional/FunctionalTestCase.php @@ -14,6 +14,7 @@ use Dotenv\Dotenv; use GuzzleHttp\Client as HttpClient; +use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Solr\Solr; use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; use Psr\Http\Message\ResponseInterface; @@ -331,6 +332,7 @@ protected function setUpSolr(int $uid, int $storagePid, array $solrFixtures): So // Setup Solr only once for all tests in this suite if ($this->solr === null) { + Helper::resetIndexNameCache(); $coreName = Solr::createCore(); $this->solr = Solr::getInstance($coreName); foreach ($solrFixtures as $filePath) { From a2b29cbfbb0fb48cfe54eceb72f6eed32e415526 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 22:59:09 +0200 Subject: [PATCH 046/111] Fix deprecations and warnings reported by phpunit for Typo3 v13 update. --- Classes/Common/Helper.php | 2 +- Classes/Common/MetsDocument.php | 8 ++--- Classes/Common/Solr/Solr.php | 12 +++---- Classes/Common/Solr/SolrSearch.php | 8 ++--- Classes/Common/StdOutStream.php | 7 ++++ Classes/Controller/OaiPmhController.php | 34 ++++++++----------- .../Domain/Repository/DocumentRepository.php | 2 +- 7 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index c684ace04f..acad2d8c86 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -414,7 +414,7 @@ public static function getCleanString(string $string): string public static function getHookObjects(string $scriptRelPath): array { $hookObjects = []; - if (is_array(self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'])) { + if (is_array(self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'] ?? null)) { foreach (self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) { $hookObjects[] = GeneralUtility::makeInstance($classRef); } diff --git a/Classes/Common/MetsDocument.php b/Classes/Common/MetsDocument.php index 13205cc39b..a461eceafd 100644 --- a/Classes/Common/MetsDocument.php +++ b/Classes/Common/MetsDocument.php @@ -227,18 +227,18 @@ protected function establishRecordId(int $pid): void public function getDownloadLocation(string $id): string { $file = $this->getFileInfo($id); - if ($file['mimeType'] === 'application/vnd.kitodo.iiif') { + if (!empty($file) && $file['mimeType'] === 'application/vnd.kitodo.iiif') { $file['location'] = (strrpos($file['location'], 'info.json') === strlen($file['location']) - 9) ? $file['location'] : (strrpos($file['location'], '/') === strlen($file['location']) ? $file['location'] . 'info.json' : $file['location'] . '/info.json'); $service = self::loadIiifResource($file['location']); if ($service instanceof AbstractImageService) { return $service->getImageUrl(); } - } elseif ($file['mimeType'] === 'application/vnd.netfpx') { + } elseif (!empty($file) && $file['mimeType'] === 'application/vnd.netfpx') { $baseURL = $file['location'] . (str_contains($file['location'], '?') ? '' : '?'); // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' return $baseURL . '&CVT=jpeg'; } - return $file['location']; + return $file['location'] ?? null; } /** @@ -1174,7 +1174,7 @@ public function getFullText(string $id): string if ($this->hasFulltext) { $useGroups = $this->useGroupsConfiguration->getFulltext(); - $physicalStructureNode = $this->physicalStructureInfo[$id]; + $physicalStructureNode = $this->physicalStructureInfo[$id] ?? null; $fileLocations = []; if (!empty($physicalStructureNode)) { diff --git a/Classes/Common/Solr/Solr.php b/Classes/Common/Solr/Solr.php index 975a20d710..19916865ae 100644 --- a/Classes/Common/Solr/Solr.php +++ b/Classes/Common/Solr/Solr.php @@ -256,7 +256,7 @@ public static function getFields(): array self::$fields['type'] = $solrFields['type']; self::$fields['title'] = $solrFields['title']; self::$fields['volume'] = $solrFields['volume']; - self::$fields['date'] = $solrFields['date']; + self::$fields['date'] = $solrFields['date'] ?? null; self::$fields['thumbnail'] = $solrFields['thumbnail']; self::$fields['default'] = $solrFields['default']; self::$fields['timestamp'] = $solrFields['timestamp']; @@ -356,19 +356,19 @@ protected function loadSolrConnectionInfo(): void // Derive Solr host name. $config['host'] = ($conf['host'] ? $conf['host'] : '127.0.0.1'); // Set username and password. - $config['username'] = $conf['user']; - $config['password'] = $conf['pass']; + $config['username'] = $conf['user'] ?? null; + $config['password'] = $conf['pass'] ?? null; // Set port if not set. - $config['port'] = MathUtility::forceIntegerInRange($conf['port'], 1, 65535, 8983); + $config['port'] = MathUtility::forceIntegerInRange($conf['port'] ?? null, 1, 65535, 8983); // Trim path of slashes and (re-)add trailing slash if path not empty. - $config['path'] = trim($conf['path'], '/'); + $config['path'] = trim($conf['path'] ?? '', '/'); if (!empty($config['path'])) { $config['path'] .= '/'; } // Set connection timeout lower than PHP's max_execution_time. $maxExecutionTime = (int) ini_get('max_execution_time') ? : 30; - $config['timeout'] = MathUtility::forceIntegerInRange($conf['timeout'], 1, $maxExecutionTime, 10); + $config['timeout'] = MathUtility::forceIntegerInRange($conf['timeout'] ?? null, 1, $maxExecutionTime, 10); $this->config = $config; } } diff --git a/Classes/Common/Solr/SolrSearch.php b/Classes/Common/Solr/SolrSearch.php index 61e044b587..120f08400a 100644 --- a/Classes/Common/Solr/SolrSearch.php +++ b/Classes/Common/Solr/SolrSearch.php @@ -212,7 +212,7 @@ public function valid(): bool */ public function offsetExists($offset): bool { - $idx = $this->result['document_keys'][$offset]; + $idx = $this->result['document_keys'][$offset] ?? null; return isset($this->result['documents'][$idx]); } @@ -228,7 +228,7 @@ public function offsetExists($offset): bool #[\ReturnTypeWillChange] public function offsetGet($offset) { - $idx = $this->result['document_keys'][$offset]; + $idx = $this->result['document_keys'][$offset] ?? null; $document = $this->result['documents'][$idx] ?? null; if ($document !== null) { @@ -659,7 +659,7 @@ protected function fetchToplevelMetadataFromSolr(array $queryParams): array foreach ($result['documents'] as $doc) { $this->translateLanguageCode($doc); - $metadataArray[$doc['uid']] = $doc['metadata']; + $metadataArray[$doc['uid']] = $doc['metadata'] ?? null; } return $metadataArray; @@ -911,7 +911,7 @@ private function getDocument(Document $record, array $highlighting, array $field */ private function translateLanguageCode(&$doc): void { - if (is_array($doc['metadata']) && array_key_exists('language', $doc['metadata'])) { + if (is_array($doc['metadata'] ?? null) && array_key_exists('language', $doc['metadata'])) { foreach($doc['metadata']['language'] as $indexName => $language) { $doc['metadata']['language'][$indexName] = Helper::getLanguageName($language); } diff --git a/Classes/Common/StdOutStream.php b/Classes/Common/StdOutStream.php index 2a12b674fd..0ae5f262a4 100644 --- a/Classes/Common/StdOutStream.php +++ b/Classes/Common/StdOutStream.php @@ -28,6 +28,13 @@ class StdOutStream implements StreamInterface, SelfEmittableStreamInterface { use StreamDecoratorTrait; + /** + * Constructor + */ + public function __construct( + protected readonly StreamInterface $stream + ) {} + /** * @access public * diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index 5a15fb50dc..f36849d4fb 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -11,6 +11,7 @@ namespace Kitodo\Dlf\Controller; +use DateTime; use DOMDocument; use TYPO3\CMS\Core\Utility\GeneralUtility; use Kitodo\Dlf\Common\Solr\Solr; @@ -680,9 +681,9 @@ private function getFrom(): string // Check "from" for valid value. if (!empty($this->parameters['from'])) { // Is valid format? - $date = $this->getDate('from'); - if (is_array($date)) { - $from = $this->getDateFromTimestamp($date, '.000Z'); + $date = $this->getDateTimeFromParameter('from'); + if ($date) { + $from = $this->dateTimeToString($date, '.000Z'); } else { $this->error = 'badArgument'; } @@ -705,9 +706,9 @@ private function getUntil(string $from): string // Check "until" for valid value. if (!empty($this->parameters['until'])) { // Is valid format? - $date = $this->getDate('until'); - if (is_array($date)) { - $until = $this->getDateFromTimestamp($date, '.999Z'); + $date = $this->getDateTimeFromParameter('until'); + if ($date) { + $until = $this->dateTimeToString($date, '.999Z'); if ($from != "*" && $from > $until) { $this->error = 'badArgument'; } @@ -725,11 +726,12 @@ private function getUntil(string $from): string * * @param string $dateType * - * @return array|false + * @return DateTime|false */ - private function getDate(string $dateType) + private function getDateTimeFromParameter(string $dateType) { - return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ?: strptime($this->parameters[$dateType], '%Y-%m-%d'); + return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $this->parameters[$dateType]) + ?: DateTime::createFromFormat('Y-m-d', $this->parameters[$dateType]); } /** @@ -742,17 +744,9 @@ private function getDate(string $dateType) * * @return string */ - private function getDateFromTimestamp(array $date, string $end): string + private function dateTimeToString(DateTime $date, string $end): string { - $timestamp = gmmktime( - $date['tm_hour'], - $date['tm_min'], - $date['tm_sec'], - $date['tm_mon'] + 1, - $date['tm_mday'], - $date['tm_year'] + 1900 - ); - return date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . $end; + return $date->format('Y-m-d') . 'T' . $date->format("H:i:s") . $end; } /** @@ -803,7 +797,7 @@ protected function generateOutputForDocumentList(array $documentListSet) if ($verb === 'ListRecords') { // Add metadata node. - $metadataPrefix = $this->parameters['metadataPrefix']; + $metadataPrefix = $this->parameters['metadataPrefix'] ?? null; if (!$metadataPrefix) { // If we resume an action the metadataPrefix is stored with the documentSet $metadataPrefix = $documentListSet['metadata']['metadataPrefix']; diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index fa304be509..9b9a0b4b1c 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -550,7 +550,7 @@ public function findAllByUids(array $uids, bool $checkPartof = false): array $documentStructures = Helper::getDocumentStructures($this->settings['storagePid']); // Process documents in a usable array structure while ($resArray = $kitodoDocuments->fetchAssociative()) { - $resArray['structure'] = $documentStructures[$resArray['structure']]; + $resArray['structure'] = $documentStructures[$resArray['structure']] ?? null; $allDocuments[$resArray['uid']] = $resArray; } From ab669500a080a563829d4281a450b65e80e0fd19 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Aug 2025 23:18:52 +0200 Subject: [PATCH 047/111] Make SolrSearchQueryTest work to prevent empty test class warning of phpunit. --- Tests/Functional/Common/SolrSearchQueryTest.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Tests/Functional/Common/SolrSearchQueryTest.php b/Tests/Functional/Common/SolrSearchQueryTest.php index 4625cdfe07..9ee0040988 100644 --- a/Tests/Functional/Common/SolrSearchQueryTest.php +++ b/Tests/Functional/Common/SolrSearchQueryTest.php @@ -44,26 +44,29 @@ public function setUp(): void { parent::setUp(); $this->setUpData(self::$databaseFixtures); - $this->setUpSolr(4, 0, self::$solrFixtures); + $this->setUpSolr(4, 20000, self::$solrFixtures); } /** - * @ignore + * @test */ public function canExecute() { $documentRepository = $this->initializeRepository(DocumentRepository::class, 0); - $settings = ['solrcore' => 4, 'storagePid' => 0]; + $settings = ['solrcore' => 4, 'storagePid' => 20000]; + + // FIXME: test would fail because it is not possible to set $this->settings['storagePid'] for the + // documentRepository used in DocumentRepository.php:502 + // as a workaround, call $documentRepository->findSolrWithoutCollection to register settings + $documentRepository->findSolrWithoutCollection($settings, []); $params = ['query' => '10 Keyboard pieces']; $search = new SolrSearch($documentRepository, [], $settings, $params); $search->prepare(); $solrSearchQuery = $search->getQuery(); $result = $solrSearchQuery->execute(); - // FIXME: test would fail because it is not possible to set $this->settings['storagePid'] for the - // documentRepository used in DocumentRepository.php:502 - self::assertCount(0, $result); - self::assertEquals(0, $solrSearchQuery->getLimit()); + self::assertCount(1, $result); + self::assertEquals(1, $solrSearchQuery->getLimit()); } } From a865013d693ee54203a2766912a4533d2a915925 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 12:07:59 +0200 Subject: [PATCH 048/111] Remove internal_type option which is not evaluated any more for Typo3 v13 update. --- Configuration/FlexForms/Basket.xml | 1 - Configuration/FlexForms/Calendar.xml | 2 -- Configuration/FlexForms/Collection.xml | 3 --- Configuration/FlexForms/Feeds.xml | 1 - Configuration/FlexForms/ListView.xml | 2 -- Configuration/FlexForms/Metadata.xml | 1 - Configuration/FlexForms/Navigation.xml | 1 - Configuration/FlexForms/PageGrid.xml | 1 - Configuration/FlexForms/PageView.xml | 1 - Configuration/FlexForms/Search.xml | 2 -- Configuration/FlexForms/TableOfContents.xml | 2 -- Configuration/TCA/tx_dlf_documents.php | 1 - 12 files changed, 18 deletions(-) diff --git a/Configuration/FlexForms/Basket.xml b/Configuration/FlexForms/Basket.xml index 462ced97ec..f83e5a5906 100644 --- a/Configuration/FlexForms/Basket.xml +++ b/Configuration/FlexForms/Basket.xml @@ -83,7 +83,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/Calendar.xml b/Configuration/FlexForms/Calendar.xml index 8efca97b4a..947dbd63a6 100644 --- a/Configuration/FlexForms/Calendar.xml +++ b/Configuration/FlexForms/Calendar.xml @@ -23,7 +23,6 @@ group - db pages 1 1 @@ -41,7 +40,6 @@ group - db tx_dlf_documents 1 1 diff --git a/Configuration/FlexForms/Collection.xml b/Configuration/FlexForms/Collection.xml index a9188f4c4e..2d7a6eac9a 100644 --- a/Configuration/FlexForms/Collection.xml +++ b/Configuration/FlexForms/Collection.xml @@ -95,7 +95,6 @@ group - db pages 1 1 @@ -113,7 +112,6 @@ group - db pages 1 1 @@ -125,7 +123,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/Feeds.xml b/Configuration/FlexForms/Feeds.xml index 292dacecaa..ef2241d8b0 100644 --- a/Configuration/FlexForms/Feeds.xml +++ b/Configuration/FlexForms/Feeds.xml @@ -79,7 +79,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/ListView.xml b/Configuration/FlexForms/ListView.xml index ca0bbdbe70..111c3152b7 100644 --- a/Configuration/FlexForms/ListView.xml +++ b/Configuration/FlexForms/ListView.xml @@ -45,7 +45,6 @@ group - db pages 1 1 @@ -81,7 +80,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/Metadata.xml b/Configuration/FlexForms/Metadata.xml index 11a6bc6b9a..4d0f06f0a2 100644 --- a/Configuration/FlexForms/Metadata.xml +++ b/Configuration/FlexForms/Metadata.xml @@ -41,7 +41,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/Navigation.xml b/Configuration/FlexForms/Navigation.xml index a76609fe82..b31e740d3c 100644 --- a/Configuration/FlexForms/Navigation.xml +++ b/Configuration/FlexForms/Navigation.xml @@ -105,7 +105,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/PageGrid.xml b/Configuration/FlexForms/PageGrid.xml index 9900eee3bc..c922e379bf 100644 --- a/Configuration/FlexForms/PageGrid.xml +++ b/Configuration/FlexForms/PageGrid.xml @@ -104,7 +104,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/PageView.xml b/Configuration/FlexForms/PageView.xml index 753059e659..a635866ad1 100644 --- a/Configuration/FlexForms/PageView.xml +++ b/Configuration/FlexForms/PageView.xml @@ -107,7 +107,6 @@ FIELD:settings.basketButton:REQ:TRUE group - db pages 1 1 diff --git a/Configuration/FlexForms/Search.xml b/Configuration/FlexForms/Search.xml index 7c142be394..ae6859b205 100644 --- a/Configuration/FlexForms/Search.xml +++ b/Configuration/FlexForms/Search.xml @@ -242,7 +242,6 @@ group - db pages 1 1 @@ -260,7 +259,6 @@ group - db pages 1 1 diff --git a/Configuration/FlexForms/TableOfContents.xml b/Configuration/FlexForms/TableOfContents.xml index 61c7eabbe6..dfcf01b001 100644 --- a/Configuration/FlexForms/TableOfContents.xml +++ b/Configuration/FlexForms/TableOfContents.xml @@ -39,7 +39,6 @@ group - db pages 1 1 @@ -57,7 +56,6 @@ group - db pages 1 1 diff --git a/Configuration/TCA/tx_dlf_documents.php b/Configuration/TCA/tx_dlf_documents.php index 2ae6d5c3d2..34a2cd234b 100644 --- a/Configuration/TCA/tx_dlf_documents.php +++ b/Configuration/TCA/tx_dlf_documents.php @@ -258,7 +258,6 @@ 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.partof', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'tx_dlf_documents', 'prepend_tname' => 0, 'size' => 1, From accdb758e7a803f5459fcbbe75a637286358240f Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 12:18:20 +0200 Subject: [PATCH 049/111] Migrate TCA required option from eval list to separate option for Typo3 v13 update. --- Configuration/TCA/tx_dlf_actionlog.php | 3 ++- Configuration/TCA/tx_dlf_basket.php | 3 ++- Configuration/TCA/tx_dlf_collections.php | 6 ++++-- Configuration/TCA/tx_dlf_documents.php | 3 ++- Configuration/TCA/tx_dlf_formats.php | 9 ++++++--- Configuration/TCA/tx_dlf_libraries.php | 6 ++++-- Configuration/TCA/tx_dlf_mail.php | 2 +- Configuration/TCA/tx_dlf_metadata.php | 6 ++++-- Configuration/TCA/tx_dlf_metadataformat.php | 3 ++- Configuration/TCA/tx_dlf_metadatasubentries.php | 9 ++++++--- Configuration/TCA/tx_dlf_printer.php | 5 +++-- Configuration/TCA/tx_dlf_solrcores.php | 3 ++- Configuration/TCA/tx_dlf_structures.php | 6 ++++-- Configuration/TCA/tx_dlf_tokens.php | 3 ++- 14 files changed, 44 insertions(+), 23 deletions(-) diff --git a/Configuration/TCA/tx_dlf_actionlog.php b/Configuration/TCA/tx_dlf_actionlog.php index 5d7b8c08fb..47711354db 100644 --- a/Configuration/TCA/tx_dlf_actionlog.php +++ b/Configuration/TCA/tx_dlf_actionlog.php @@ -33,7 +33,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_basket.php b/Configuration/TCA/tx_dlf_basket.php index c7b7d985cf..38e093d0b1 100644 --- a/Configuration/TCA/tx_dlf_basket.php +++ b/Configuration/TCA/tx_dlf_basket.php @@ -34,7 +34,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_collections.php b/Configuration/TCA/tx_dlf_collections.php index d4209a6622..c9d0c388df 100644 --- a/Configuration/TCA/tx_dlf_collections.php +++ b/Configuration/TCA/tx_dlf_collections.php @@ -96,7 +96,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], @@ -108,7 +109,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,uniqueInPid', + 'required' => true, + 'eval' => 'uniqueInPid', 'default' => '', 'fieldInformation' => [ 'editInProductionWarning' => [ diff --git a/Configuration/TCA/tx_dlf_documents.php b/Configuration/TCA/tx_dlf_documents.php index 34a2cd234b..f03b58be95 100644 --- a/Configuration/TCA/tx_dlf_documents.php +++ b/Configuration/TCA/tx_dlf_documents.php @@ -118,7 +118,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,uniqueInPid', + 'required' => true, + 'eval' => 'uniqueInPid', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_formats.php b/Configuration/TCA/tx_dlf_formats.php index 4f6d38664c..bc946d2ce4 100644 --- a/Configuration/TCA/tx_dlf_formats.php +++ b/Configuration/TCA/tx_dlf_formats.php @@ -32,7 +32,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', + 'required' => true, + 'eval' => 'nospace,alphanum_x,uniqueInPid', 'default' => '', ], ], @@ -42,7 +43,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', + 'required' => true, + 'eval' => 'nospace,alphanum_x,uniqueInPid', 'default' => '', ], ], @@ -52,7 +54,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,nospace', + 'required' => true, + 'eval' => 'nospace', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_libraries.php b/Configuration/TCA/tx_dlf_libraries.php index a5a50a40a9..574719b793 100644 --- a/Configuration/TCA/tx_dlf_libraries.php +++ b/Configuration/TCA/tx_dlf_libraries.php @@ -62,7 +62,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], @@ -74,7 +75,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,uniqueInPid', + 'required' => true, + 'eval' => 'uniqueInPid', 'default' => '', 'fieldInformation' => [ 'editInProductionWarning' => [ diff --git a/Configuration/TCA/tx_dlf_mail.php b/Configuration/TCA/tx_dlf_mail.php index b8cd2a4756..61d2743085 100644 --- a/Configuration/TCA/tx_dlf_mail.php +++ b/Configuration/TCA/tx_dlf_mail.php @@ -29,7 +29,7 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required', + 'required' => true, 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_metadata.php b/Configuration/TCA/tx_dlf_metadata.php index 3f70708ace..78c2be0884 100644 --- a/Configuration/TCA/tx_dlf_metadata.php +++ b/Configuration/TCA/tx_dlf_metadata.php @@ -73,7 +73,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], @@ -85,7 +86,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', + 'required' => true, + 'eval' => 'nospace,alphanum_x,uniqueInPid', 'default' => '', 'fieldInformation' => [ 'editInProductionWarning' => [ diff --git a/Configuration/TCA/tx_dlf_metadataformat.php b/Configuration/TCA/tx_dlf_metadataformat.php index 9fd3f9b213..3c047d2681 100644 --- a/Configuration/TCA/tx_dlf_metadataformat.php +++ b/Configuration/TCA/tx_dlf_metadataformat.php @@ -53,7 +53,8 @@ 'type' => 'input', 'size' => 30, 'max' => 1024, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_metadatasubentries.php b/Configuration/TCA/tx_dlf_metadatasubentries.php index 386aa7d3fe..3d32ff36d6 100644 --- a/Configuration/TCA/tx_dlf_metadatasubentries.php +++ b/Configuration/TCA/tx_dlf_metadatasubentries.php @@ -39,7 +39,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], @@ -51,7 +52,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', + 'required' => true, + 'eval' => 'nospace,alphanum_x,uniqueInPid', 'default' => '', 'fieldInformation' => [ 'editInProductionWarning' => [ @@ -67,7 +69,8 @@ 'type' => 'input', 'size' => 30, 'max' => 1024, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_printer.php b/Configuration/TCA/tx_dlf_printer.php index c33b21e3be..50d2e0e131 100644 --- a/Configuration/TCA/tx_dlf_printer.php +++ b/Configuration/TCA/tx_dlf_printer.php @@ -29,7 +29,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], @@ -39,7 +40,7 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required', + 'required' => true, 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_solrcores.php b/Configuration/TCA/tx_dlf_solrcores.php index 2f5dc68ae6..6c8da48767 100644 --- a/Configuration/TCA/tx_dlf_solrcores.php +++ b/Configuration/TCA/tx_dlf_solrcores.php @@ -32,7 +32,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], diff --git a/Configuration/TCA/tx_dlf_structures.php b/Configuration/TCA/tx_dlf_structures.php index 6d40a34592..a7e41686e1 100644 --- a/Configuration/TCA/tx_dlf_structures.php +++ b/Configuration/TCA/tx_dlf_structures.php @@ -83,7 +83,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], @@ -95,7 +96,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,nospace,alphanum_x,uniqueInPid', + 'required' => true, + 'eval' => 'nospace,alphanum_x,uniqueInPid', 'default' => '', 'fieldInformation' => [ 'editInProductionWarning' => [ diff --git a/Configuration/TCA/tx_dlf_tokens.php b/Configuration/TCA/tx_dlf_tokens.php index 997ce00ab1..979403d397 100644 --- a/Configuration/TCA/tx_dlf_tokens.php +++ b/Configuration/TCA/tx_dlf_tokens.php @@ -29,7 +29,8 @@ 'type' => 'input', 'size' => 30, 'max' => 255, - 'eval' => 'required,trim', + 'required' => true, + 'eval' => 'trim', 'default' => '', ], ], From 559db5da02952e387229102af432b5939356930f Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 12:35:38 +0200 Subject: [PATCH 050/111] Migrate TCA datetime fields from type input to type datetime for Typo3 v13 update. --- Configuration/TCA/tx_dlf_documents.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Configuration/TCA/tx_dlf_documents.php b/Configuration/TCA/tx_dlf_documents.php index f03b58be95..a0d59bad49 100644 --- a/Configuration/TCA/tx_dlf_documents.php +++ b/Configuration/TCA/tx_dlf_documents.php @@ -45,27 +45,21 @@ 'tstamp' => [ 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.timestamp', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime', + 'type' => 'datetime', ] ], 'crdate' => [ 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.creationDate', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime', + 'type' => 'datetime', ] ], 'starttime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'default' => 0, ], ], @@ -73,10 +67,8 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'default' => 0, ], ], From 7063491c1121fcc88a88fb549c5f4a74b49e7e0b Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 12:48:10 +0200 Subject: [PATCH 051/111] Migrate TCA number fields from type input to type number for Typo3 v13 update. --- Configuration/TCA/tx_dlf_actionlog.php | 5 ++--- Configuration/TCA/tx_dlf_metadata.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Configuration/TCA/tx_dlf_actionlog.php b/Configuration/TCA/tx_dlf_actionlog.php index 47711354db..af6d807883 100644 --- a/Configuration/TCA/tx_dlf_actionlog.php +++ b/Configuration/TCA/tx_dlf_actionlog.php @@ -67,10 +67,9 @@ 'count_pages' => [ 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_actionlog.count_pages', 'config' => [ - 'type' => 'input', + 'type' => 'number', 'size' => 30, - 'max' => 11, - 'eval' => 'num,int', + 'format' => 'integer', 'default' => 0, ], ], diff --git a/Configuration/TCA/tx_dlf_metadata.php b/Configuration/TCA/tx_dlf_metadata.php index 78c2be0884..e4c1b84f45 100644 --- a/Configuration/TCA/tx_dlf_metadata.php +++ b/Configuration/TCA/tx_dlf_metadata.php @@ -180,11 +180,10 @@ 'l10n_mode' => 'exclude', 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_metadata.index_boost', 'config' => [ - 'type' => 'input', + 'type' => 'number', 'size' => 5, - 'max' => 5, 'default' => 1.0, - 'eval' => 'double2', + 'format' => 'decimal', ], ], 'is_sortable' => [ From 4dac0d6e2e3952c4522cf9a36048e6c27ddf1bf8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 12:59:32 +0200 Subject: [PATCH 052/111] Remote TCA ctrl definition cruser_id which is not evaluated any more for Typo3 v13 update. --- Configuration/TCA/tx_dlf_actionlog.php | 1 - Configuration/TCA/tx_dlf_collections.php | 1 - Configuration/TCA/tx_dlf_documents.php | 1 - Configuration/TCA/tx_dlf_formats.php | 1 - Configuration/TCA/tx_dlf_libraries.php | 1 - Configuration/TCA/tx_dlf_metadata.php | 1 - Configuration/TCA/tx_dlf_metadataformat.php | 1 - Configuration/TCA/tx_dlf_metadatasubentries.php | 1 - Configuration/TCA/tx_dlf_solrcores.php | 1 - Configuration/TCA/tx_dlf_structures.php | 1 - Configuration/TCA/tx_dlf_tokens.php | 1 - 11 files changed, 11 deletions(-) diff --git a/Configuration/TCA/tx_dlf_actionlog.php b/Configuration/TCA/tx_dlf_actionlog.php index af6d807883..71564e6393 100644 --- a/Configuration/TCA/tx_dlf_actionlog.php +++ b/Configuration/TCA/tx_dlf_actionlog.php @@ -15,7 +15,6 @@ 'title' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_actionlog', 'label' => 'label', 'crdate' => 'crdate', - 'cruser_id' => 'user_id', 'default_sortby' => 'ORDER BY label', 'delete' => 'deleted', 'iconfile' => 'EXT:dlf/Resources/Public/Icons/txdlfreport.png', diff --git a/Configuration/TCA/tx_dlf_collections.php b/Configuration/TCA/tx_dlf_collections.php index c9d0c388df..92bf9867f7 100644 --- a/Configuration/TCA/tx_dlf_collections.php +++ b/Configuration/TCA/tx_dlf_collections.php @@ -16,7 +16,6 @@ 'label' => 'label', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'fe_cruser_id' => 'fe_cruser_id', 'fe_admin_lock' => 'fe_admin_lock', 'languageField' => 'sys_language_uid', diff --git a/Configuration/TCA/tx_dlf_documents.php b/Configuration/TCA/tx_dlf_documents.php index a0d59bad49..d845e4492c 100644 --- a/Configuration/TCA/tx_dlf_documents.php +++ b/Configuration/TCA/tx_dlf_documents.php @@ -16,7 +16,6 @@ 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'default_sortby' => 'ORDER BY title_sorting', 'delete' => 'deleted', 'enablecolumns' => [ diff --git a/Configuration/TCA/tx_dlf_formats.php b/Configuration/TCA/tx_dlf_formats.php index bc946d2ce4..333e331cee 100644 --- a/Configuration/TCA/tx_dlf_formats.php +++ b/Configuration/TCA/tx_dlf_formats.php @@ -16,7 +16,6 @@ 'label' => 'type', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'default_sortby' => 'ORDER BY type', 'delete' => 'deleted', 'iconfile' => 'EXT:dlf/Resources/Public/Icons/txdlfformats.png', diff --git a/Configuration/TCA/tx_dlf_libraries.php b/Configuration/TCA/tx_dlf_libraries.php index 574719b793..d4db05376d 100644 --- a/Configuration/TCA/tx_dlf_libraries.php +++ b/Configuration/TCA/tx_dlf_libraries.php @@ -16,7 +16,6 @@ 'label' => 'label', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l18n_parent', 'transOrigDiffSourceField' => 'l18n_diffsource', diff --git a/Configuration/TCA/tx_dlf_metadata.php b/Configuration/TCA/tx_dlf_metadata.php index e4c1b84f45..8ab66b2464 100644 --- a/Configuration/TCA/tx_dlf_metadata.php +++ b/Configuration/TCA/tx_dlf_metadata.php @@ -16,7 +16,6 @@ 'label' => 'label', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l18n_parent', 'transOrigDiffSourceField' => 'l18n_diffsource', diff --git a/Configuration/TCA/tx_dlf_metadataformat.php b/Configuration/TCA/tx_dlf_metadataformat.php index 3c047d2681..695bdc23de 100644 --- a/Configuration/TCA/tx_dlf_metadataformat.php +++ b/Configuration/TCA/tx_dlf_metadataformat.php @@ -16,7 +16,6 @@ 'label' => 'encoded', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'delete' => 'deleted', 'iconfile' => 'EXT:dlf/Resources/Public/Icons/txdlfmetadata.png', 'rootLevel' => 0, diff --git a/Configuration/TCA/tx_dlf_metadatasubentries.php b/Configuration/TCA/tx_dlf_metadatasubentries.php index 3d32ff36d6..a73c052ed8 100644 --- a/Configuration/TCA/tx_dlf_metadatasubentries.php +++ b/Configuration/TCA/tx_dlf_metadatasubentries.php @@ -16,7 +16,6 @@ 'label' => 'label', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l18n_parent', 'transOrigDiffSourceField' => 'l18n_diffsource', diff --git a/Configuration/TCA/tx_dlf_solrcores.php b/Configuration/TCA/tx_dlf_solrcores.php index 6c8da48767..52eb7e004b 100644 --- a/Configuration/TCA/tx_dlf_solrcores.php +++ b/Configuration/TCA/tx_dlf_solrcores.php @@ -16,7 +16,6 @@ 'label' => 'label', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'default_sortby' => 'ORDER BY label', 'delete' => 'deleted', 'iconfile' => 'EXT:dlf/Resources/Public/Icons/txdlfsolrcores.png', diff --git a/Configuration/TCA/tx_dlf_structures.php b/Configuration/TCA/tx_dlf_structures.php index a7e41686e1..ab6b4aba61 100644 --- a/Configuration/TCA/tx_dlf_structures.php +++ b/Configuration/TCA/tx_dlf_structures.php @@ -16,7 +16,6 @@ 'label' => 'label', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l18n_parent', 'transOrigDiffSourceField' => 'l18n_diffsource', diff --git a/Configuration/TCA/tx_dlf_tokens.php b/Configuration/TCA/tx_dlf_tokens.php index 979403d397..735741e095 100644 --- a/Configuration/TCA/tx_dlf_tokens.php +++ b/Configuration/TCA/tx_dlf_tokens.php @@ -16,7 +16,6 @@ 'label' => 'token', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'default_sortby' => 'ORDER BY token', 'iconfile' => 'EXT:dlf/Resources/Public/Icons/txdlfsolrcores.png', 'rootLevel' => -1, From 973e3198b859043eda50176447a864f54c3acf89 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 13:13:50 +0200 Subject: [PATCH 053/111] Migrate TCA select items option to associative array for Typo3 v13 update. --- Configuration/TCA/tx_dlf_actionlog.php | 5 +- Configuration/TCA/tx_dlf_collections.php | 60 +++++++++++++++++++----- Configuration/TCA/tx_dlf_documents.php | 30 +++++++++--- Configuration/TCA/tx_dlf_libraries.php | 5 +- Configuration/TCA/tx_dlf_metadata.php | 10 +++- Configuration/TCA/tx_dlf_structures.php | 15 ++++-- 6 files changed, 100 insertions(+), 25 deletions(-) diff --git a/Configuration/TCA/tx_dlf_actionlog.php b/Configuration/TCA/tx_dlf_actionlog.php index 71564e6393..81988bd8a7 100644 --- a/Configuration/TCA/tx_dlf_actionlog.php +++ b/Configuration/TCA/tx_dlf_actionlog.php @@ -43,7 +43,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.fe_cruser_id.none', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.fe_cruser_id.none', + 'value' => 0, + ], ], 'foreign_table' => 'fe_users', 'foreign_table_where' => 'ORDER BY fe_users.username', diff --git a/Configuration/TCA/tx_dlf_collections.php b/Configuration/TCA/tx_dlf_collections.php index 92bf9867f7..1dcfcd2b01 100644 --- a/Configuration/TCA/tx_dlf_collections.php +++ b/Configuration/TCA/tx_dlf_collections.php @@ -50,7 +50,10 @@ 'foreign_table' => 'tx_dlf_collections', 'foreign_table_where' => 'AND tx_dlf_collections.pid=###CURRENT_PID### AND tx_dlf_collections.sys_language_uid IN (-1,0)', 'items' => [ - ['', 0], + [ + 'label' => '', + 'value' => 0, + ], ], 'default' => 0, ], @@ -76,9 +79,18 @@ 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'fe_groups', 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', '-1'], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', '-2'], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups', '--div--'], + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', + 'value' => '-1', + ], + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', + 'value' => '-2', + ], + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups', + 'value' => '--div--', + ], ], 'size' => 5, 'autoSizeMax' => 15, @@ -183,11 +195,26 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['1', 1], - ['2', 2], - ['3', 3], - ['4', 4], - ['5', 5], + [ + 'label' => '1', + 'value' => 1, + ], + [ + 'label' => '2', + 'value' => 2, + ], + [ + 'label' => '3', + 'value' => 3, + ], + [ + 'label' => '4', + 'value' => 4, + ], + [ + 'label' => '5', + 'value' => 5, + ], ], 'size' => 1, 'minitems' => 1, @@ -225,7 +252,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.owner.none', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.owner.none', + 'value' => 0, + ], ], 'foreign_table' => 'tx_dlf_libraries', 'foreign_table_where' => 'AND tx_dlf_libraries.sys_language_uid IN (-1,0) ORDER BY tx_dlf_libraries.label', @@ -243,7 +273,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.fe_cruser_id.none', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.fe_cruser_id.none', + 'value' => 0, + ], ], 'foreign_table' => 'fe_users', 'foreign_table_where' => 'ORDER BY fe_users.username', @@ -270,7 +303,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.status.default', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.status.default', + 'value' => 0, + ], ], 'size' => 1, 'minitems' => 1, diff --git a/Configuration/TCA/tx_dlf_documents.php b/Configuration/TCA/tx_dlf_documents.php index d845e4492c..b366d13919 100644 --- a/Configuration/TCA/tx_dlf_documents.php +++ b/Configuration/TCA/tx_dlf_documents.php @@ -78,9 +78,18 @@ 'type' => 'select', 'renderType' => 'selectMultipleSideBySide', 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', '-1'], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', '-2'], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups', '--div--'], + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', + 'value' => '-1', + ], + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', + 'value' => '-2', + ], + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups', + 'value' => '--div--', + ], ], 'foreign_table' => 'fe_groups', 'size' => 5, @@ -410,7 +419,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.status.default', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.status.default', + 'value' => 0, + ], ], 'size' => 1, 'minitems' => 1, @@ -425,8 +437,14 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.document_format.mets', 'METS'], - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.document_format.iiif', 'IIIF'], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.document_format.mets', + 'value' => 'METS', + ], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.document_format.iiif', + 'value' => 'IIIF', + ], ], 'size' => 1, 'minitems' => 1, diff --git a/Configuration/TCA/tx_dlf_libraries.php b/Configuration/TCA/tx_dlf_libraries.php index d4db05376d..2440d23cd0 100644 --- a/Configuration/TCA/tx_dlf_libraries.php +++ b/Configuration/TCA/tx_dlf_libraries.php @@ -44,7 +44,10 @@ 'foreign_table' => 'tx_dlf_libraries', 'foreign_table_where' => 'AND tx_dlf_libraries.pid=###CURRENT_PID### AND tx_dlf_libraries.sys_language_uid IN (-1,0)', 'items' => [ - ['', 0], + [ + 'label' => '', + 'value' => 0, + ], ], 'default' => 0, ], diff --git a/Configuration/TCA/tx_dlf_metadata.php b/Configuration/TCA/tx_dlf_metadata.php index 8ab66b2464..3a1fb3c677 100644 --- a/Configuration/TCA/tx_dlf_metadata.php +++ b/Configuration/TCA/tx_dlf_metadata.php @@ -47,7 +47,10 @@ 'foreign_table' => 'tx_dlf_metadata', 'foreign_table_where' => 'AND tx_dlf_metadata.pid=###CURRENT_PID### AND tx_dlf_metadata.sys_language_uid IN (-1,0) ORDER BY label ASC', 'items' => [ - ['', 0], + [ + 'label' => '', + 'value' => 0, + ], ], 'default' => 0, ], @@ -229,7 +232,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_metadata.status.default', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_metadata.status.default', + 'value' => 0, + ], ], 'size' => 1, 'minitems' => 1, diff --git a/Configuration/TCA/tx_dlf_structures.php b/Configuration/TCA/tx_dlf_structures.php index ab6b4aba61..943b05256e 100644 --- a/Configuration/TCA/tx_dlf_structures.php +++ b/Configuration/TCA/tx_dlf_structures.php @@ -47,7 +47,10 @@ 'foreign_table' => 'tx_dlf_structures', 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY label ASC', 'items' => [ - ['', 0], + [ + 'label' => '', + 'value' => 0, + ], ], 'default' => 0, ], @@ -126,7 +129,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_structures.thumbnail.self', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_structures.thumbnail.self', + 'value' => 0, + ], ], 'foreign_table' => 'tx_dlf_structures', 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.toplevel=0 AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY tx_dlf_structures.label', @@ -143,7 +149,10 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_structures.status.default', 0], + [ + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_structures.status.default', + 'value' => 0, + ], ], 'size' => 1, 'minitems' => 1, From 21b64f8bc2322c5a3b8d605b8a422f4c38d6ad09 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 13:24:00 +0200 Subject: [PATCH 054/111] Fix SolrTest::canGetNextCoreNumber to check increment of one instead of fixed core number. --- Tests/Functional/Common/SolrTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/Functional/Common/SolrTest.php b/Tests/Functional/Common/SolrTest.php index 395ce64a67..e53eacfaa8 100644 --- a/Tests/Functional/Common/SolrTest.php +++ b/Tests/Functional/Common/SolrTest.php @@ -65,9 +65,10 @@ public function canEscapeQueryKeepField() */ public function canGetNextCoreNumber() { - self::assertEquals(4, Solr::getNextCoreNumber()); + $currentCoreNumber = Solr::getNextCoreNumber(); + self::assertGreaterThan(0, $currentCoreNumber); Solr::createCore(); - self::assertEquals(5, Solr::getNextCoreNumber()); + self::assertEquals($currentCoreNumber + 1, Solr::getNextCoreNumber()); } /** From 573119d69372e6d92dde9cb04cdfed7bae8e6aa2 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 16 Aug 2025 17:15:34 +0200 Subject: [PATCH 055/111] Extend version range for symfony/process back to 6.4 such that PHP 8.1 can be used with Typo3 v12. Readd Typo3 v12 with PHP 8.1 to test matrix. --- .github/workflows/tests.yml | 2 +- composer.json | 2 +- ext_emconf.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f1893621b4..4ff1473f6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - variants: [ {typo3: 12.4, php: 8.2}, {typo3: 12.4, php: 8.4}, {typo3: 13.4, php: 8.2}, {typo3: 13.4, php: 8.4} ] + variants: [ {typo3: 12.4, php: 8.1}, {typo3: 12.4, php: 8.4}, {typo3: 13.4, php: 8.2}, {typo3: 13.4, php: 8.4} ] steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/composer.json b/composer.json index 2dccb1ae8e..ee02d9b2d8 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "ubl/php-iiif-prezi-reader": "0.3", "solarium/solarium": "^6.3", "softcreatr/jsonpath": "^0.10", - "symfony/process": "^7.3" + "symfony/process": "^6.4|^7.3" }, "require-dev": { "phpstan/phpstan": "^1.12", diff --git a/ext_emconf.php b/ext_emconf.php index 64723cf16d..b93e367f00 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,7 +17,7 @@ 'category' => 'misc', 'constraints' => [ 'depends' => [ - 'php' => '8.2.0-8.4.99', + 'php' => '8.1.0-8.4.99', 'typo3' => '12.4.0-13.4.99' ], 'conflicts' => [], From a1d23509b8da76a8556b8786e18953f16c1955ed Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 20 Aug 2025 12:23:05 +0200 Subject: [PATCH 056/111] Fix phpstan issues. --- Classes/Common/Solr/SolrSearch.php | 3 +++ Classes/Common/Solr/SolrSearchQuery.php | 1 - Classes/Common/TypoScriptHelper.php | 3 +++ Classes/Controller/AbstractController.php | 2 +- Classes/Controller/Backend/NewTenantController.php | 9 ++++++--- Classes/Controller/BasketController.php | 3 ++- Classes/Controller/SearchController.php | 1 + Classes/Domain/Repository/DocumentRepository.php | 5 ++++- Classes/Domain/Repository/LibraryRepository.php | 1 + Classes/ViewHelpers/StdWrapViewHelper.php | 6 ++++-- 10 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Classes/Common/Solr/SolrSearch.php b/Classes/Common/Solr/SolrSearch.php index 120f08400a..f312f299db 100644 --- a/Classes/Common/Solr/SolrSearch.php +++ b/Classes/Common/Solr/SolrSearch.php @@ -491,6 +491,7 @@ public function prepare() if ($this->listedMetadata) { foreach ($this->listedMetadata as $metadata) { + /** @var \Kitodo\Dlf\Domain\Model\Metadata $metadata */ if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); $params['fields'] .= ',' . $listMetadataRecord; @@ -644,6 +645,7 @@ protected function fetchToplevelMetadataFromSolr(array $queryParams): array if ($this->listedMetadata) { foreach ($this->listedMetadata as $metadata) { + /** @var \Kitodo\Dlf\Domain\Model\Metadata $metadata */ if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); $params['fields'] .= ',' . $listMetadataRecord; @@ -714,6 +716,7 @@ protected function searchSolr($parameters = [], $enableCache = true) if ($this->indexedMetadata) { foreach ($this->indexedMetadata as $metadata) { + /** @var \Kitodo\Dlf\Domain\Model\Metadata $metadata */ if ($metadata->getIndexIndexed()) { $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . 'i'; $queryFields .= $listMetadataRecord . '^' . $metadata->getIndexBoost() . ' '; diff --git a/Classes/Common/Solr/SolrSearchQuery.php b/Classes/Common/Solr/SolrSearchQuery.php index e548df541e..c47d59678d 100644 --- a/Classes/Common/Solr/SolrSearchQuery.php +++ b/Classes/Common/Solr/SolrSearchQuery.php @@ -51,7 +51,6 @@ public function __construct(SolrSearch $solrSearch) * @return array */ // TODO: Return type (array) of method SolrSearchQuery::execute() should be compatible with return type (iterable&TYPO3\CMS\Extbase\Persistence\QueryResultInterface) of method TYPO3\CMS\Extbase\Persistence\QueryInterface::execute() - // @phpstan-ignore-next-line public function execute($returnRawQueryResult = false) { $this->solrSearch->submit($this->offset, $this->limit); diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index 64e75a2c3a..17471745cc 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -65,6 +65,7 @@ public function getTyposcriptConfigV13(int $pid): array $sysTemplateRows = $this->sysTemplateRepository->getSysTemplateRowsByRootline($rootLine); $frontendTypoScriptFactory = GeneralUtility::makeInstance( + // @phpstan-ignore-next-line (class does not exist in Typo3 v12) \TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory::class, $this->container, $this->eventDispatcher, @@ -74,6 +75,7 @@ public function getTyposcriptConfigV13(int $pid): array $this->includeTreeTraverserConditionVerdictAware, ); + // @phpstan-ignore-next-line ($frontendTypoScriptFactory does not exist in Typo3 v12) $frontendTypoScript = $frontendTypoScriptFactory->createSettingsAndSetupConditions( $site, $sysTemplateRows, @@ -81,6 +83,7 @@ public function getTyposcriptConfigV13(int $pid): array null, ); + // @phpstan-ignore-next-line ($frontendTypoScriptFactory does not exist in Typo3 v12) $ts = $frontendTypoScriptFactory->createSetupConfigOrFullSetup( true, $frontendTypoScript, diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 9b4c41e77a..906c3b68af 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -121,7 +121,7 @@ protected function initialize(RequestInterface $request): void { /** @var Request $request */ $this->requestData = $request->getQueryParams()['tx_dlf'] ?? []; - $this->pageUid = (int) $request->getQueryParams()['id'] ?? null; + $this->pageUid = (int) ($request->getQueryParams()['id'] ?? null); $this->requestData['page'] = $this->requestData['page'] ?? 1; // Sanitize user input to prevent XSS attacks. diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index a5bd8dab84..81a3f70acd 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -150,7 +150,7 @@ public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) * * @param bool $isError whether to render the non-error or error template * - * @param array $extra extra view data used to render the template (in addition to $viewData of AbstractController) + * @param array $extraData extra view data used to render the template (in addition to $viewData of AbstractController) * * @return ResponseInterface the response */ @@ -177,7 +177,7 @@ protected function templateResponse(bool $isError, array $extraData): ResponseIn */ protected function initializeAction(): void { - $this->pid = (int) $this->request->getQueryParams()['id'] ?? null; + $this->pid = (int) ($this->request->getQueryParams()['id'] ?? null); $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); $frameworkConfiguration['persistence']['storagePid'] = $this->pid; @@ -289,6 +289,7 @@ public function addMetadataAction(): ResponseInterface $insertedMetadata = []; foreach ($metadataIds as $id => $uid) { + /** @var \Kitodo\Dlf\Domain\Model\Metadata $metadata */ $metadata = $this->metadataRepository->findByUid($uid); // id array contains also ids of formats if ($metadata != null) { @@ -384,7 +385,9 @@ public function addStructureAction(): ResponseInterface $insertedStructures = []; foreach ($structureIds as $id => $uid) { - $insertedStructures[$uid] = $this->structureRepository->findByUid($uid)->getIndexName(); + /** @var \Kitodo\Dlf\Domain\Model\Structure $structure */ + $structure = $this->structureRepository->findByUid($uid); + $insertedStructures[$uid] = $structure->getIndexName(); } foreach ($this->siteLanguages as $siteLanguage) { diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index 0c6e90ac61..50531d20e6 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -553,7 +553,8 @@ protected function sendMail(): void // send mail $mailId = $this->requestData['mail_action']; - $mailObject = $this->mailRepository->findByUid(intval($mailId))->getFirst(); + /** @var \Kitodo\Dlf\Domain\Model\Mail $mailObject */ + $mailObject = $this->mailRepository->findByUid(intval($mailId)); $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n"; $numberOfPages = 0; diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index bc1e080f59..368e116de9 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -409,6 +409,7 @@ private function addCollectionsQuery(string $query): string $virtualCollectionsQueryString = ''; foreach ($collections as $collectionEntry) { // check for virtual collections query string + /** @var Collection $collectionEntry */ if ($collectionEntry->getIndexSearch()) { $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; } else { diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 9b9a0b4b1c..ecccef4066 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -36,6 +36,7 @@ * * @access public * + * @method Document|null findByUid(int|null $uid) Get a document by its UID * @method Document|null findOneByUid(int $uid) Get a document by its UID * @method Document|null findOneByRecordId(string $recordId) Get a document by its record ID * @method Document|null findOneByIndexName(string $indexName) Get a document by its index name @@ -120,7 +121,9 @@ public function findOldestDocument(): ?Document $query->setOrderings(['tstamp' => QueryInterface::ORDER_ASCENDING]); $query->setLimit(1); - return $query->execute()->getFirst(); + /** @var Document $document */ + $document = $query->execute()->getFirst(); + return $document; } /** diff --git a/Classes/Domain/Repository/LibraryRepository.php b/Classes/Domain/Repository/LibraryRepository.php index d4696e3c4b..7ee050095e 100644 --- a/Classes/Domain/Repository/LibraryRepository.php +++ b/Classes/Domain/Repository/LibraryRepository.php @@ -23,6 +23,7 @@ * * @access public * + * @method Library|null findByUid(int|null $uid) Get a library by its UID * @method Library|null findOneByIndexName(string $indexName) Get a library by its index name */ class LibraryRepository extends Repository diff --git a/Classes/ViewHelpers/StdWrapViewHelper.php b/Classes/ViewHelpers/StdWrapViewHelper.php index 0c8c6aa6a8..fefa0d4411 100644 --- a/Classes/ViewHelpers/StdWrapViewHelper.php +++ b/Classes/ViewHelpers/StdWrapViewHelper.php @@ -55,10 +55,12 @@ public function render(): string $wrap = $this->arguments['wrap']; $data = $this->arguments['data'] ?? []; - if (!$this->renderingContext->getRequest()) { + /** @var \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext $renderingContext */ + $renderingContext = $this->renderingContext; + if (!$renderingContext->getRequest()) { throw new \RuntimeException('Required request not found in RenderingContext'); } - $request = $this->renderingContext->getRequest(); + $request = $renderingContext->getRequest(); $cObj = $request->getAttribute('currentContentObject'); $insideContent = $this->renderChildren(); From e7c5bc71f7f7103703c7ada927f9770ee60f3026 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 20 Aug 2025 12:26:20 +0200 Subject: [PATCH 057/111] Remove phpstan ignore rule. --- .github/phpstan.neon | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/phpstan.neon b/.github/phpstan.neon index 080183c9d9..9d2e14f8af 100644 --- a/.github/phpstan.neon +++ b/.github/phpstan.neon @@ -3,7 +3,6 @@ parameters: - '#Call to an undefined method Psr\\Http\\Message\\RequestFactoryInterface::request\(\)\.#' - '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\ManifestInterface::getOriginalJsonArray\(\)\.#' - '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\RangeInterface::getMemberRangesAndRanges\(\)\.#' - - '#^Parameter \#2 \$callback of function array_filter expects \(callable\(mixed\)\: bool\)\|null, ''strlen'' given\.$#' level: 5 paths: - ../Classes/ From cee4d30e3e6c640bdd1987f27ca2115add2d003e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 20 Aug 2025 12:50:18 +0200 Subject: [PATCH 058/111] Fix code style issues. --- Classes/Common/Helper.php | 4 ++-- Classes/Common/Indexer.php | 12 ++++++----- Classes/Common/Solr/SolrSearch.php | 4 ++-- Classes/Common/StdOutStream.php | 6 +++--- Classes/Common/TypoScriptHelper.php | 5 +++-- Classes/Controller/BasketController.php | 2 +- Configuration/TCA/tx_dlf_collections.php | 10 ++++----- Configuration/TCA/tx_dlf_structures.php | 2 +- Tests/Functional/Api/OaiPmhTypo3Client.php | 21 ++++++++----------- .../Api/PageViewProxyDisabledTest.php | 6 +++--- Tests/Functional/Api/PageViewProxyTest.php | 6 +++--- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index acad2d8c86..563ce93204 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -79,7 +79,7 @@ class Helper /** * @access protected - * @static + * @static * @var array A cache remembering which Solr core uid belongs to which index name */ protected static array $indexNameCache = []; @@ -486,7 +486,7 @@ public static function getIndexNameFromUid(int $uid, string $table, int $pid = - /** * Reset the index name cache. - * + * * @access public * * @static diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index be918107e4..786e91a660 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -164,11 +164,13 @@ public static function add(Document $document, DocumentRepository $documentRepos ContextualFeedbackSeverity::OK ); } else { - self::addErrorMessage(sprintf( - Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentNotIndexed'), - $document->getTitle(), - $document->getUid() - )); + self::addErrorMessage( + sprintf( + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentNotIndexed'), + $document->getTitle(), + $document->getUid() + ) + ); } } return $success; diff --git a/Classes/Common/Solr/SolrSearch.php b/Classes/Common/Solr/SolrSearch.php index f312f299db..eff7546893 100644 --- a/Classes/Common/Solr/SolrSearch.php +++ b/Classes/Common/Solr/SolrSearch.php @@ -105,8 +105,8 @@ public function __construct( array $settings = [], array $searchParams = [], ?QueryResult $listedMetadata = null, - ?QueryResult $indexedMetadata = null) - { + ?QueryResult $indexedMetadata = null + ) { $this->documentRepository = $documentRepository; $this->collections = $collections; $this->settings = $settings; diff --git a/Classes/Common/StdOutStream.php b/Classes/Common/StdOutStream.php index 0ae5f262a4..e1ed3d6d0f 100644 --- a/Classes/Common/StdOutStream.php +++ b/Classes/Common/StdOutStream.php @@ -31,9 +31,9 @@ class StdOutStream implements StreamInterface, SelfEmittableStreamInterface /** * Constructor */ - public function __construct( - protected readonly StreamInterface $stream - ) {} + public function __construct(protected readonly StreamInterface $stream) + { + } /** * @access public diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index 17471745cc..9a91efccde 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -45,7 +45,8 @@ public function __construct( private readonly IncludeTreeTraverser $includeTreeTraverser, private readonly ConditionVerdictAwareIncludeTreeTraverser $includeTreeTraverserConditionVerdictAware, private readonly SysTemplateRepository $sysTemplateRepository, - ) {} + ) { + } /** * Extract typoScript configuration from site root for Typo3 v13 @@ -149,4 +150,4 @@ public static function getTyposcriptConfig(int $pid): array } return TypoScriptHelper::getTyposcriptConfigV12($pid); } -} \ No newline at end of file +} diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index 50531d20e6..bdfd521a7d 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -554,7 +554,7 @@ protected function sendMail(): void $mailId = $this->requestData['mail_action']; /** @var \Kitodo\Dlf\Domain\Model\Mail $mailObject */ - $mailObject = $this->mailRepository->findByUid(intval($mailId)); + $mailObject = $this->mailRepository->findByUid((int) $mailId); $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n"; $numberOfPages = 0; diff --git a/Configuration/TCA/tx_dlf_collections.php b/Configuration/TCA/tx_dlf_collections.php index 1dcfcd2b01..b7b8667131 100644 --- a/Configuration/TCA/tx_dlf_collections.php +++ b/Configuration/TCA/tx_dlf_collections.php @@ -196,23 +196,23 @@ 'renderType' => 'selectSingle', 'items' => [ [ - 'label' => '1', + 'label' => '1', 'value' => 1, ], [ - 'label' => '2', + 'label' => '2', 'value' => 2, ], [ - 'label' => '3', + 'label' => '3', 'value' => 3, ], [ - 'label' => '4', + 'label' => '4', 'value' => 4, ], [ - 'label' => '5', + 'label' => '5', 'value' => 5, ], ], diff --git a/Configuration/TCA/tx_dlf_structures.php b/Configuration/TCA/tx_dlf_structures.php index 943b05256e..d0aed99d56 100644 --- a/Configuration/TCA/tx_dlf_structures.php +++ b/Configuration/TCA/tx_dlf_structures.php @@ -150,7 +150,7 @@ 'renderType' => 'selectSingle', 'items' => [ [ - 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_structures.status.default', + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_structures.status.default', 'value' => 0, ], ], diff --git a/Tests/Functional/Api/OaiPmhTypo3Client.php b/Tests/Functional/Api/OaiPmhTypo3Client.php index 34d073f806..98eff69df5 100644 --- a/Tests/Functional/Api/OaiPmhTypo3Client.php +++ b/Tests/Functional/Api/OaiPmhTypo3Client.php @@ -23,7 +23,7 @@ /** * Custom implementation of Phpoaipmh\ClientInterface such that Phpoaipmh\Endpoint can be used * to test the Typo3 OAI endpoint. - * + * * See: https://github.com/caseyamcl/phpoaipmh/blob/master/src/ClientInterface.php */ class OaiPmhTypo3Client implements ClientInterface @@ -59,11 +59,10 @@ class OaiPmhTypo3Client implements ClientInterface */ public function __construct( string $baseUrl, - int $pageId, - FunctionalTestCase $functionalTestCase, + int $pageId, + FunctionalTestCase $functionalTestCase, bool $throwError = true - ) - { + ) { $this->baseUrl = $baseUrl; $this->pageId = $pageId; $this->functionalTestCase = $functionalTestCase; @@ -75,14 +74,13 @@ public function __construct( * * @param $verb the verb as string * @param array $params additional options + * @throws OaipmhException if there is an OaiPmh error and $throwError is true * @return SimpleXMLElement the parsed response as XML element */ - public function request($verb, array $params = array()) { + public function request($verb, array $params = array()) + { $request = (new InternalRequest($this->baseUrl))->withQueryParameters( - array_merge([ - 'id' => $this->pageId, - 'verb' => $verb, - ], $params) + array_merge([ 'id' => $this->pageId, 'verb' => $verb ], $params) ); $response = $this->functionalTestCase->executeInternalRequest($request); @@ -110,5 +108,4 @@ public function getHttpAdapter() { return null; } - -} \ No newline at end of file +} diff --git a/Tests/Functional/Api/PageViewProxyDisabledTest.php b/Tests/Functional/Api/PageViewProxyDisabledTest.php index 3f2c42fd77..1b4dedc50d 100644 --- a/Tests/Functional/Api/PageViewProxyDisabledTest.php +++ b/Tests/Functional/Api/PageViewProxyDisabledTest.php @@ -33,9 +33,9 @@ class PageViewProxyDisabledTest extends FunctionalTestCase */ protected function queryProxy(array $query, string $method = 'GET'): ResponseInterface { - $request = (new InternalRequest($this->baseUrl))->withQueryParameters(array_merge([ - 'eID' => 'tx_dlf_pageview_proxy', - ], $query))->withMethod($method); + $request = (new InternalRequest($this->baseUrl))->withQueryParameters( + array_merge([ 'eID' => 'tx_dlf_pageview_proxy' ], $query) + )->withMethod($method); return $this->executeInternalRequest($request); } diff --git a/Tests/Functional/Api/PageViewProxyTest.php b/Tests/Functional/Api/PageViewProxyTest.php index 91857fd74a..d35f9d7f1c 100644 --- a/Tests/Functional/Api/PageViewProxyTest.php +++ b/Tests/Functional/Api/PageViewProxyTest.php @@ -54,9 +54,9 @@ protected function getDlfConfiguration(): array */ protected function queryProxy(array $query, string $method = 'GET'): ResponseInterface { - $request = (new InternalRequest($this->baseUrl))->withQueryParameters(array_merge([ - 'eID' => 'tx_dlf_pageview_proxy', - ], $query))->withMethod($method); + $request = (new InternalRequest($this->baseUrl))->withQueryParameters( + array_merge([ 'eID' => 'tx_dlf_pageview_proxy' ], $query) + )->withMethod($method); return $this->executeInternalRequest($request); } From 5e56e8ceb7a45d4315dcaa9e1d02675ee3ed02f5 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 20 Aug 2025 13:32:50 +0200 Subject: [PATCH 059/111] Fix codestyle issues. --- Classes/Common/Indexer.php | 8 ++++---- Classes/Common/Solr/SolrSearch.php | 3 ++- Classes/Common/StdOutStream.php | 2 +- Classes/Common/TypoScriptHelper.php | 15 ++++++++------- Classes/Controller/OaiPmhController.php | 2 +- Classes/ViewHelpers/StdWrapViewHelper.php | 4 +++- Configuration/TCA/tx_dlf_collections.php | 6 +++--- Configuration/TCA/tx_dlf_documents.php | 2 +- Configuration/TCA/tx_dlf_libraries.php | 2 +- Tests/Functional/Api/OaiPmhTest.php | 13 +++---------- Tests/Functional/Api/OaiPmhTypo3Client.php | 14 ++++++++------ Tests/Functional/FunctionalTestCase.php | 4 ++-- .../ViewHelpers/StdWrapViewHelperTest.php | 2 +- 13 files changed, 38 insertions(+), 39 deletions(-) diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 786e91a660..bb0214ac70 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -156,8 +156,8 @@ public static function add(Document $document, DocumentRepository $documentRepos if ($success) { self::addMessage( sprintf( - Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentIndexed'), - $document->getTitle(), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentIndexed'), + $document->getTitle(), $document->getUid() ), 'flash.done', @@ -166,8 +166,8 @@ public static function add(Document $document, DocumentRepository $documentRepos } else { self::addErrorMessage( sprintf( - Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentNotIndexed'), - $document->getTitle(), + Helper::getLanguageService()->sL(self::LANG_PREFIX . 'flash.documentNotIndexed'), + $document->getTitle(), $document->getUid() ) ); diff --git a/Classes/Common/Solr/SolrSearch.php b/Classes/Common/Solr/SolrSearch.php index eff7546893..a40ab9aba2 100644 --- a/Classes/Common/Solr/SolrSearch.php +++ b/Classes/Common/Solr/SolrSearch.php @@ -106,7 +106,8 @@ public function __construct( array $searchParams = [], ?QueryResult $listedMetadata = null, ?QueryResult $indexedMetadata = null - ) { + ) + { $this->documentRepository = $documentRepository; $this->collections = $collections; $this->settings = $settings; diff --git a/Classes/Common/StdOutStream.php b/Classes/Common/StdOutStream.php index e1ed3d6d0f..3467d4f278 100644 --- a/Classes/Common/StdOutStream.php +++ b/Classes/Common/StdOutStream.php @@ -31,7 +31,7 @@ class StdOutStream implements StreamInterface, SelfEmittableStreamInterface /** * Constructor */ - public function __construct(protected readonly StreamInterface $stream) + public function __construct(protected readonly StreamInterface $stream) { } diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index 9a91efccde..bd1c9affe4 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -43,9 +43,10 @@ public function __construct( private readonly SysTemplateTreeBuilder $treeBuilder, private readonly LossyTokenizer $tokenizer, private readonly IncludeTreeTraverser $includeTreeTraverser, - private readonly ConditionVerdictAwareIncludeTreeTraverser $includeTreeTraverserConditionVerdictAware, + private readonly ConditionVerdictAwareIncludeTreeTraverser $includeConditionVerdictAware, private readonly SysTemplateRepository $sysTemplateRepository, - ) { + ) + { } /** @@ -67,13 +68,13 @@ public function getTyposcriptConfigV13(int $pid): array $frontendTypoScriptFactory = GeneralUtility::makeInstance( // @phpstan-ignore-next-line (class does not exist in Typo3 v12) - \TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory::class, + \TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory::class, $this->container, $this->eventDispatcher, $this->treeBuilder, $this->tokenizer, $this->includeTreeTraverser, - $this->includeTreeTraverserConditionVerdictAware, + $this->includeConditionVerdictAware, ); // @phpstan-ignore-next-line ($frontendTypoScriptFactory does not exist in Typo3 v12) @@ -113,7 +114,7 @@ public static function getTyposcriptConfigV12(int $pid): array $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); $site = $siteFinder->getSiteByPageId($pid); $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pid)->get(); - + $typoScriptFrontendController = GeneralUtility::makeInstance( TypoScriptFrontendController::class, GeneralUtility::makeInstance(Context::class), @@ -132,10 +133,10 @@ public static function getTyposcriptConfigV12(int $pid): array /** * Get TypoScript configuration from site root - * + * * Note: When upgrading Typo3, maybe use site settings to store storagePid, see: * https://docs.typo3.org/permalink/t3coreapi:sitehandling-settings - * + * * @access public * * @param int $pid page id diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index f36849d4fb..42b3995382 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -730,7 +730,7 @@ private function getUntil(string $from): string */ private function getDateTimeFromParameter(string $dateType) { - return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $this->parameters[$dateType]) + return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $this->parameters[$dateType]) ?: DateTime::createFromFormat('Y-m-d', $this->parameters[$dateType]); } diff --git a/Classes/ViewHelpers/StdWrapViewHelper.php b/Classes/ViewHelpers/StdWrapViewHelper.php index fefa0d4411..afff9a8037 100644 --- a/Classes/ViewHelpers/StdWrapViewHelper.php +++ b/Classes/ViewHelpers/StdWrapViewHelper.php @@ -11,6 +11,7 @@ namespace Kitodo\Dlf\ViewHelpers; +use \RuntimeException; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; /** @@ -48,6 +49,7 @@ public function initializeArguments(): void * * @access public * + * @thorws RuntimeException if view helper is used outside of request context * @return string */ public function render(): string @@ -58,7 +60,7 @@ public function render(): string /** @var \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext $renderingContext */ $renderingContext = $this->renderingContext; if (!$renderingContext->getRequest()) { - throw new \RuntimeException('Required request not found in RenderingContext'); + throw new RuntimeException('Required request not found in RenderingContext'); } $request = $renderingContext->getRequest(); $cObj = $request->getAttribute('currentContentObject'); diff --git a/Configuration/TCA/tx_dlf_collections.php b/Configuration/TCA/tx_dlf_collections.php index b7b8667131..e1888c0c6b 100644 --- a/Configuration/TCA/tx_dlf_collections.php +++ b/Configuration/TCA/tx_dlf_collections.php @@ -51,7 +51,7 @@ 'foreign_table_where' => 'AND tx_dlf_collections.pid=###CURRENT_PID### AND tx_dlf_collections.sys_language_uid IN (-1,0)', 'items' => [ [ - 'label' => '', + 'label' => '', 'value' => 0, ], ], @@ -80,11 +80,11 @@ 'foreign_table' => 'fe_groups', 'items' => [ [ - 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', 'value' => '-1', ], [ - 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', 'value' => '-2', ], [ diff --git a/Configuration/TCA/tx_dlf_documents.php b/Configuration/TCA/tx_dlf_documents.php index b366d13919..73d84e377c 100644 --- a/Configuration/TCA/tx_dlf_documents.php +++ b/Configuration/TCA/tx_dlf_documents.php @@ -442,7 +442,7 @@ 'value' => 'METS', ], [ - 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.document_format.iiif', + 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_documents.document_format.iiif', 'value' => 'IIIF', ], ], diff --git a/Configuration/TCA/tx_dlf_libraries.php b/Configuration/TCA/tx_dlf_libraries.php index 2440d23cd0..48a573e52f 100644 --- a/Configuration/TCA/tx_dlf_libraries.php +++ b/Configuration/TCA/tx_dlf_libraries.php @@ -45,7 +45,7 @@ 'foreign_table_where' => 'AND tx_dlf_libraries.pid=###CURRENT_PID### AND tx_dlf_libraries.sys_language_uid IN (-1,0)', 'items' => [ [ - 'label' => '', + 'label' => '', 'value' => 0, ], ], diff --git a/Tests/Functional/Api/OaiPmhTest.php b/Tests/Functional/Api/OaiPmhTest.php index c67b51ed49..59ee2aa512 100644 --- a/Tests/Functional/Api/OaiPmhTest.php +++ b/Tests/Functional/Api/OaiPmhTest.php @@ -198,9 +198,7 @@ public function canUseResumptionToken() // The general handling of resumption tokens should be the same for these verbs foreach (['ListIdentifiers', 'ListRecords'] as $verb) { // Check that we get a proper resumption token when starting a list - $xml = $client->request($verb, [ - 'metadataPrefix' => 'mets', - ]); + $xml = $client->request($verb, [ 'metadataPrefix' => 'mets' ]); $resumptionToken = $xml->$verb->resumptionToken; self::assertEquals('0', (string) $resumptionToken['cursor']); @@ -214,9 +212,7 @@ public function canUseResumptionToken() // Check that we can resume and get a proper cursor value $cursor = 1; do { - $xml = $client->request($verb, [ - 'resumptionToken' => (string) $resumptionToken, - ]); + $xml = $client->request($verb, [ 'resumptionToken' => (string) $resumptionToken ]); $resumptionToken = $xml->$verb->resumptionToken; $tokenStr = (string) $resumptionToken; @@ -242,10 +238,7 @@ public function noResumptionTokenForCompleteList() $client = new OaiPmhTypo3Client($this->baseUrl, $this->oaiPage, $this); foreach (['ListIdentifiers', 'ListRecords'] as $verb) { - $xml = $client->request($verb, [ - 'metadataPrefix' => 'mets', - 'set' => 'collection-with-single-document', - ]); + $xml = $client->request($verb, [ 'metadataPrefix' => 'mets', 'set' => 'collection-with-single-document' ]); self::assertCount(1, $xml->$verb->children()); self::assertEmpty($xml->$verb->resumptionToken); diff --git a/Tests/Functional/Api/OaiPmhTypo3Client.php b/Tests/Functional/Api/OaiPmhTypo3Client.php index 98eff69df5..75cbd49b3c 100644 --- a/Tests/Functional/Api/OaiPmhTypo3Client.php +++ b/Tests/Functional/Api/OaiPmhTypo3Client.php @@ -12,6 +12,7 @@ namespace Kitodo\Dlf\Tests\Functional\Api; +use \Exception; use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; use Phpoaipmh\ClientInterface; use Phpoaipmh\Exception\OaipmhException; @@ -19,7 +20,6 @@ use SimpleXMLElement; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; - /** * Custom implementation of Phpoaipmh\ClientInterface such that Phpoaipmh\Endpoint can be used * to test the Typo3 OAI endpoint. @@ -51,18 +51,19 @@ class OaiPmhTypo3Client implements ClientInterface /** * Initialize a OaiPmh client. - * + * * @param string $baseUrl the base url of the Typo3 server used for functional tests * @param int $pageId the Typo3 page id of the OAI endpoint * @param FunctionalTestCase $funtionalTestCase reference to the functional test case in order to issue internal requests * @param bool $throwError whether to throw an OaiPmhException if the OAI response contains error information */ public function __construct( - string $baseUrl, + string $baseUrl, int $pageId, FunctionalTestCase $functionalTestCase, bool $throwError = true - ) { + ) + { $this->baseUrl = $baseUrl; $this->pageId = $pageId; $this->functionalTestCase = $functionalTestCase; @@ -71,13 +72,14 @@ public function __construct( /** * Issue a OaiPmh request for a given verb and options. - * + * * @param $verb the verb as string * @param array $params additional options * @throws OaipmhException if there is an OaiPmh error and $throwError is true + * @throws MalformedResponseException if the XML response cannot be parsed * @return SimpleXMLElement the parsed response as XML element */ - public function request($verb, array $params = array()) + public function request($verb, array $params = []) { $request = (new InternalRequest($this->baseUrl))->withQueryParameters( array_merge([ 'id' => $this->pageId, 'verb' => $verb ], $params) diff --git a/Tests/Functional/FunctionalTestCase.php b/Tests/Functional/FunctionalTestCase.php index 159382822b..28f550cb04 100644 --- a/Tests/Functional/FunctionalTestCase.php +++ b/Tests/Functional/FunctionalTestCase.php @@ -100,7 +100,7 @@ class FunctionalTestCase extends \TYPO3\TestingFramework\Core\Functional\Functio public function setUp(): void { $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); - + parent::setUp(); $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); @@ -371,7 +371,7 @@ protected static function assertArrayMatches(array $sub, array $super, string $m /** * Execute an internal Typo3 Http request and return its response. - * + * * @param InternalRequest $request the request * @return ResponseInterface the response */ diff --git a/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php b/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php index 882debedb7..7801e5dea3 100644 --- a/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php @@ -34,7 +34,7 @@ class StdWrapViewHelperTest extends FunctionalTestCase public function renderWithStdWrap(): void { $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); - + $request = new ServerRequest(); $request = $request->withAttribute("currentContentObject", $cObj); From 0092e11e0f3861e7acafc21b60f25dd844f824ca Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 20 Aug 2025 14:51:18 +0200 Subject: [PATCH 060/111] Replace deprecated repository magic findBy methods. --- Classes/Command/BaseCommand.php | 8 +-- Classes/Command/DeleteCommand.php | 4 +- Classes/Command/HarvestCommand.php | 2 +- Classes/Command/IndexCommand.php | 6 +- Classes/Command/ReindexCommand.php | 2 +- Classes/Common/Solr/SolrSearch.php | 19 +++--- Classes/Controller/AbstractController.php | 4 +- .../Backend/NewTenantController.php | 10 +-- Classes/Controller/BasketController.php | 6 +- Classes/Controller/CalendarController.php | 10 ++- Classes/Controller/CollectionController.php | 6 +- Classes/Controller/ListViewController.php | 6 +- Classes/Controller/MetadataController.php | 4 +- Classes/Controller/OaiPmhController.php | 6 +- Classes/Controller/SearchController.php | 6 +- .../Domain/Repository/BasketRepository.php | 5 +- .../Repository/CollectionRepository.php | 2 +- .../Domain/Repository/DocumentRepository.php | 64 ++++++++++++------- .../Domain/Repository/FormatRepository.php | 2 - .../Domain/Repository/LibraryRepository.php | 2 +- .../Domain/Repository/MetadataRepository.php | 5 -- .../Domain/Repository/PrinterRepository.php | 2 +- .../Domain/Repository/SolrCoreRepository.php | 3 - .../Domain/Repository/StructureRepository.php | 3 +- .../DocumentTypeFunctionProvider.php | 4 +- 25 files changed, 100 insertions(+), 91 deletions(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index 6722fdb15e..352d4f865e 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -226,7 +226,7 @@ protected function saveToDatabase(Document $document, bool $softCommit = false): $document->setMetsLabel($metadata['mets_label'][0] ?? ''); $document->setMetsOrderlabel($metadata['mets_orderlabel'][0] ?? ''); - $structure = $this->structureRepository->findOneByIndexName($metadata['type'][0]); + $structure = $this->structureRepository->findOneBy([ 'indexName' => $metadata['type'][0] ]); $document->setStructure($structure); if (is_array($metadata['collection'])) { @@ -299,7 +299,7 @@ protected function getParentDocumentUidForSaving(Document $document, bool $softC $parent = AbstractDocument::getInstance($doc->parentHref, ['storagePid' => $this->storagePid], true); if ($parent->recordId) { - $parentDocument = $this->documentRepository->findOneByRecordId($parent->recordId); + $parentDocument = $this->documentRepository->findOneBy([ 'recordId' => $parent->recordId ]); if ($parentDocument === null) { // create new Document object @@ -337,7 +337,7 @@ protected function getParentDocumentUidForSaving(Document $document, bool $softC private function addCollections(Document &$document, array $collections): void { foreach ($collections as $collection) { - $documentCollection = $this->collectionRepository->findOneByIndexName($collection); + $documentCollection = $this->collectionRepository->findOneBy([ 'indexName' => $collection ]); if (!$documentCollection) { // create new Collection object $documentCollection = GeneralUtility::makeInstance(Collection::class); @@ -430,7 +430,7 @@ private function setOwner($owner): void if (empty($this->owner)) { // owner is not set set but found by metadata --> take it or take default library $owner = $owner ? : 'default'; - $this->owner = $this->libraryRepository->findOneByIndexName($owner); + $this->owner = $this->libraryRepository->findOneBy([ 'indexName' => $owner ]); if (empty($this->owner)) { // create library $this->owner = GeneralUtility::makeInstance(Library::class); diff --git a/Classes/Command/DeleteCommand.php b/Classes/Command/DeleteCommand.php index 1e1c026d7a..a8e052bbe4 100644 --- a/Classes/Command/DeleteCommand.php +++ b/Classes/Command/DeleteCommand.php @@ -220,9 +220,9 @@ private function getDocument($input): ?Document $doc = AbstractDocument::getInstance($input->getOption('doc'), ['storagePid' => $this->storagePid], true); if ($doc->recordId) { - $document = $this->documentRepository->findOneByRecordId($doc->recordId); + $document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); } else { - $document = $this->documentRepository->findOneByLocation($input->getOption('doc')); + $document = $this->documentRepository->findOneBy([ 'location' => $input->getOption('doc') ]); } } diff --git a/Classes/Command/HarvestCommand.php b/Classes/Command/HarvestCommand.php index f3bea2ece0..dfb26df837 100644 --- a/Classes/Command/HarvestCommand.php +++ b/Classes/Command/HarvestCommand.php @@ -240,7 +240,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if ($doc->recordId) { - $document = $this->documentRepository->findOneByRecordId($doc->recordId); + $document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); } if ($document === null) { diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index 00d1b2710e..73e7d17bb1 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -150,7 +150,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (MathUtility::canBeInterpretedAsInteger($input->getOption('owner'))) { $this->owner = $this->libraryRepository->findByUid(MathUtility::forceIntegerInRange((int) $input->getOption('owner'), 1)); } else { - $this->owner = $this->libraryRepository->findOneByIndexName((string) $input->getOption('owner')); + $this->owner = $this->libraryRepository->findOneBy([ 'indexName' => (string) $input->getOption('owner')]); } } else { $this->owner = null; @@ -232,9 +232,9 @@ private function getDocumentFromUrl($doc, string $url): Document $document = null; if ($doc->recordId) { - $document = $this->documentRepository->findOneByRecordId($doc->recordId); + $document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); } else { - $document = $this->documentRepository->findOneByLocation($url); + $document = $this->documentRepository->findOneBy([ 'location' => $url ]); } if ($document === null) { diff --git a/Classes/Command/ReindexCommand.php b/Classes/Command/ReindexCommand.php index 47e184324c..1f72875cb6 100644 --- a/Classes/Command/ReindexCommand.php +++ b/Classes/Command/ReindexCommand.php @@ -155,7 +155,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (MathUtility::canBeInterpretedAsInteger($input->getOption('owner'))) { $this->owner = $this->libraryRepository->findByUid(MathUtility::forceIntegerInRange((int) $input->getOption('owner'), 1)); } else { - $this->owner = $this->libraryRepository->findOneByIndexName((string) $input->getOption('owner')); + $this->owner = $this->libraryRepository->findOneBy([ 'indexName' => (string) $input->getOption('owner') ]); } } else { $this->owner = null; diff --git a/Classes/Common/Solr/SolrSearch.php b/Classes/Common/Solr/SolrSearch.php index a40ab9aba2..bb3ff083a7 100644 --- a/Classes/Common/Solr/SolrSearch.php +++ b/Classes/Common/Solr/SolrSearch.php @@ -57,15 +57,15 @@ class SolrSearch implements \Countable, \Iterator, \ArrayAccess, QueryResultInte /** * @access private - * @var QueryResult|null + * @var QueryResultInterface|null */ - private ?QueryResult $listedMetadata; + private ?QueryResultInterface $listedMetadata; /** * @access private - * @var QueryResult|null + * @var QueryResultInterface|null */ - private ?QueryResult $indexedMetadata; + private ?QueryResultInterface $indexedMetadata; /** * @access private @@ -94,8 +94,8 @@ class SolrSearch implements \Countable, \Iterator, \ArrayAccess, QueryResultInte * @param array|QueryResultInterface $collections can contain 0, 1 or many Collection objects * @param array $settings * @param array $searchParams - * @param QueryResult $listedMetadata - * @param QueryResult $indexedMetadata + * @param QueryResultInterface|null $listedMetadata + * @param QueryResultInterface|null $indexedMetadata * * @return void */ @@ -104,10 +104,9 @@ public function __construct( array|QueryResultInterface $collections, array $settings = [], array $searchParams = [], - ?QueryResult $listedMetadata = null, - ?QueryResult $indexedMetadata = null - ) - { + ?QueryResultInterface $listedMetadata = null, + ?QueryResultInterface $indexedMetadata = null + ) { $this->documentRepository = $documentRepository; $this->collections = $collections; $this->settings = $settings; diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 611751b2a7..291a995dd0 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -225,7 +225,7 @@ protected function loadDocument(string $documentId = ''): void } elseif (!empty($this->requestData['recordId'])) { - $this->document = $this->documentRepository->findOneByRecordId($this->requestData['recordId']); + $this->document = $this->documentRepository->findOneBy([ 'recordId' => $this->requestData['recordId'] ]); if ($this->document !== null) { $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings); @@ -730,7 +730,7 @@ protected function getDocumentByUrl(string $documentUrl) if ($doc->recordId) { // find document from repository by recordId - $docFromRepository = $this->documentRepository->findOneByRecordId($doc->recordId); + $docFromRepository = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); if ($docFromRepository !== null) { $this->document = $docFromRepository; } diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index 81a3f70acd..3b76b56c99 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -210,7 +210,7 @@ public function addFormatAction(): ResponseInterface foreach ($formatsDefaults as $type => $values) { // if default format record is not found, add it to the repository - if ($this->formatRepository->findOneByType($type) === null) { + if ($this->formatRepository->findOneBy([ 'type' => $type ]) === null) { $newRecord = GeneralUtility::makeInstance(Format::class); $newRecord->setType($type); $newRecord->setRoot($values['root']); @@ -333,7 +333,7 @@ public function addSolrCoreAction(): ResponseInterface // load language file in own array $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language()); - if ($this->solrCoreRepository->findOneByPid($this->pid) === null) { + if ($this->solrCoreRepository->findOneBy([ 'pid' => $this->pid ]) === null) { $newRecord = GeneralUtility::makeInstance(SolrCore::class); $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); $indexName = Solr::createCore(''); @@ -434,14 +434,14 @@ public function indexAction(): ResponseInterface $recordInfos['formats']['numDefault'] = count($formatsDefaults); $structuresDefaults = $this->getRecords('Structure'); - $recordInfos['structures']['numCurrent'] = $this->structureRepository->countByPid($this->pid); + $recordInfos['structures']['numCurrent'] = $this->structureRepository->count([ 'pid' => $this->pid ]); $recordInfos['structures']['numDefault'] = count($structuresDefaults); $metadataDefaults = $this->getRecords('Metadata'); - $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->countByPid($this->pid); + $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->count([ 'pid' => $this->pid ]); $recordInfos['metadata']['numDefault'] = count($metadataDefaults); - $recordInfos['solrcore']['numCurrent'] = $this->solrCoreRepository->countByPid($this->pid); + $recordInfos['solrcore']['numCurrent'] = $this->solrCoreRepository->count([ 'pid' => $this->pid ]); $viewData = ['recordInfos' => $recordInfos]; diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index bdfd521a7d..71dad00d20 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -245,13 +245,13 @@ protected function getBasketData(): Basket $userIsLoggedIn = $this->isUserLoggedIn(); if ($userIsLoggedIn) { - $basket = $this->basketRepository->findOneByFeUserId((int) $GLOBALS['TSFE']->fe_user->user['uid']); + $basket = $this->basketRepository->findOneBy([ 'feUserId' => (int) $GLOBALS['TSFE']->fe_user->user['uid'] ]); } else { $userSession->set('ses', 'tx_dlf_basket', ''); $userSession->dataWasUpdated(); $GLOBALS['TSFE']->fe_user->storeSessionData(); - $basket = $this->basketRepository->findOneBySessionId($userSession->getIdentifier()); + $basket = $this->basketRepository->findOneBy([ 'sessionId' => $userSession->getIdentifier() ]); } // session does not exist @@ -639,7 +639,7 @@ protected function printDocument(): void $printerId = $this->requestData['print_action']; // get id from db and send selected doc download link - $printer = $this->printerRepository->findOneByUid($printerId); + $printer = $this->printerRepository->findOneBy([ 'uid' => $printerId ]); // printer is selected if ($printer) { diff --git a/Classes/Controller/CalendarController.php b/Classes/Controller/CalendarController.php index 8225cc0182..4e5ab57260 100644 --- a/Classes/Controller/CalendarController.php +++ b/Classes/Controller/CalendarController.php @@ -159,7 +159,10 @@ public function yearsAction(): ResponseInterface } // Get all children of anchor. This should be the year anchor documents - $documents = $this->documentRepository->getChildrenOfYearAnchor($this->document->getUid(), $this->structureRepository->findOneByIndexName('year')); + $documents = $this->documentRepository->getChildrenOfYearAnchor( + $this->document->getUid(), + $this->structureRepository->findOneBy([ 'indexName' => 'year' ]) + ); $years = []; // Process results. @@ -452,7 +455,10 @@ private function getIssuesByYear(): array */ private function getIssues(): Generator { - $documents = $this->documentRepository->getChildrenOfYearAnchor($this->document->getUid(), $this->structureRepository->findOneByIndexName('issue')); + $documents = $this->documentRepository->getChildrenOfYearAnchor( + $this->document->getUid(), + $this->structureRepository->findOneBy([ 'indexName' => 'issue' ]) + ); // Process results. if ($documents->count() === 0) { diff --git a/Classes/Controller/CollectionController.php b/Classes/Controller/CollectionController.php index 1479571164..fb3efa6ccb 100644 --- a/Classes/Controller/CollectionController.php +++ b/Classes/Controller/CollectionController.php @@ -151,13 +151,13 @@ public function showAction(Collection $collection): ResponseInterface } // get all metadata records to be shown in results - $listedMetadata = $this->metadataRepository->findByIsListed(true); + $listedMetadata = $this->metadataRepository->findBy(['isListed' => true]); // get all indexed metadata fields - $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true); + $indexedMetadata = $this->metadataRepository->findBy(['indexIndexed' => true]); // get all sortable metadata records - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); + $sortableMetadata = $this->metadataRepository->findBy(['isSortable' => true]); // get all documents of given collection $solrResults = null; diff --git a/Classes/Controller/ListViewController.php b/Classes/Controller/ListViewController.php index 8de90884a8..a30c09334f 100644 --- a/Classes/Controller/ListViewController.php +++ b/Classes/Controller/ListViewController.php @@ -93,13 +93,13 @@ public function mainAction(): ResponseInterface $currentPage = $this->requestData['page'] ?? 1; // get all sortable metadata records - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); + $sortableMetadata = $this->metadataRepository->findBy(['isSortable' => true]); // get all metadata records to be shown in results - $listedMetadata = $this->metadataRepository->findByIsListed(true); + $listedMetadata = $this->metadataRepository->findBy(['isListed' => true]); // get all indexed metadata fields - $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true); + $indexedMetadata = $this->metadataRepository->findBy(['indexIndexed' => true]); $solrResults = null; $numResults = 0; diff --git a/Classes/Controller/MetadataController.php b/Classes/Controller/MetadataController.php index 32a306df03..c8ecbbf0b7 100644 --- a/Classes/Controller/MetadataController.php +++ b/Classes/Controller/MetadataController.php @@ -447,7 +447,7 @@ private function parseOwner(int $i, array &$metadata) : void */ private function parseType(int $i, array &$metadata) : void { - $structure = $this->structureRepository->findOneByIndexName($metadata[$i]['type'][0]); + $structure = $this->structureRepository->findOneBy([ 'indexName' => $metadata[$i]['type'][0] ]); if ($structure) { $metadata[$i]['type'][0] = $structure->getLabel(); } @@ -468,7 +468,7 @@ private function parseCollections(int $i, $value, array &$metadata) : void { $j = 0; foreach ($value as $entry) { - $collection = $this->collectionRepository->findOneByIndexName($entry); + $collection = $this->collectionRepository->findOneBy([ 'indexName' => $entry ]); if ($collection) { $metadata[$i]['collection'][$j] = $collection->getLabel() ? : ''; $j++; diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index 42b3995382..7e37f9cd1c 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -201,7 +201,7 @@ private function getDublinCoreData(array $record) $record[] = ['dc:format' => $record['application/mets+xml'] ?? '']; $record[] = ['dc:type' => $record['Text'] ?? '']; if (!empty($record['partof'])) { - $document = $this->documentRepository->findOneByPartof($metadata['partof'] ?? ''); + $document = $this->documentRepository->findOneBy([ 'partof' => $metadata['partof'] ?? '' ]); if ($document) { $metadata[] = ['dc:relation' => $document->getRecordId()]; @@ -317,7 +317,7 @@ public function mainAction(): ResponseInterface */ protected function resume(): ?array { - $token = $this->tokenRepository->findOneByToken($this->parameters['resumptionToken']); + $token = $this->tokenRepository->findOneBy([ 'token' => $this->parameters['resumptionToken'] ]); if ($token) { $options = $token->getOptions(); @@ -492,7 +492,7 @@ protected function verbListMetadataFormats() $resArray = []; // check for the optional "identifier" parameter if (isset($this->parameters['identifier'])) { - $resArray = $this->documentRepository->findOneByRecordId($this->parameters['identifier']); + $resArray = $this->documentRepository->findOneBy([ 'recordId' => $this->parameters['identifier'] ]); } $resultSet = []; diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index 368e116de9..830c256608 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -176,13 +176,13 @@ public function mainAction(): ResponseInterface // An empty form will be shown. if (!empty($this->search)) { // get all sortable metadata records - $sortableMetadata = $this->metadataRepository->findByIsSortable(true); + $sortableMetadata = $this->metadataRepository->findBy(['isSortable' => true]); // get all metadata records to be shown in results - $listedMetadata = $this->metadataRepository->findByIsListed(true); + $listedMetadata = $this->metadataRepository->findBy(['isListed' => true]); // get all indexed metadata fields - $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true); + $indexedMetadata = $this->metadataRepository->findBy(['indexIndexed' => true]); $solrResults = null; $numResults = 0; diff --git a/Classes/Domain/Repository/BasketRepository.php b/Classes/Domain/Repository/BasketRepository.php index fd05163f8c..cbc3396f7b 100644 --- a/Classes/Domain/Repository/BasketRepository.php +++ b/Classes/Domain/Repository/BasketRepository.php @@ -22,9 +22,8 @@ * @subpackage dlf * * @access public - * - * @method Basket|null findOneByFeUserId(int $feUserId) Get a basket by frontend user ID - * @method Basket|null findOneBySessionId(string $sessionId) Get a document by session id + * + * @method Basket|null findOneBy(array $criteria) Get a basket by criteria */ class BasketRepository extends Repository { diff --git a/Classes/Domain/Repository/CollectionRepository.php b/Classes/Domain/Repository/CollectionRepository.php index 5ca88b2ce2..205d0c548a 100644 --- a/Classes/Domain/Repository/CollectionRepository.php +++ b/Classes/Domain/Repository/CollectionRepository.php @@ -29,7 +29,7 @@ * * @access public * - * @method Collection|null findOneByIndexName(string $indexName) Get a collection by its index name + * @method Collection|null findOneBy(array $criteria) Get a collection by criteria */ class CollectionRepository extends Repository { diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 0d776c6e74..f4f0e0ac62 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -37,10 +37,7 @@ * @access public * * @method Document|null findByUid(int|null $uid) Get a document by its UID - * @method Document|null findOneByUid(int $uid) Get a document by its UID - * @method Document|null findOneByRecordId(string $recordId) Get a document by its record ID - * @method Document|null findOneByIndexName(string $indexName) Get a document by its index name - * @method Document|null findOneByLocation(string $location) Get a document by its XML location + * @method Document|null findOneBy(array $criteria) Get a document by criteria */ class DocumentRepository extends Repository { @@ -78,14 +75,14 @@ public function findOneByParameters(array $parameters): ?Document } else if (isset($parameters['recordId'])) { - $document = $this->findOneByRecordId($parameters['recordId']); + $document = $this->findOneBy([ 'recordId' => $parameters['recordId'] ]); } else if (isset($parameters['location']) && GeneralUtility::isValidUrl($parameters['location'])) { $doc = AbstractDocument::getInstance($parameters['location']); if ($doc !== null && $doc->recordId) { - $document = $this->findOneByRecordId($doc->recordId); + $document = $this->findOneBy([ 'recordId' => $doc->recordId ]); } if ($document === null) { @@ -588,13 +585,18 @@ public function findChildrenOfEach(array $uids): array * @param Collection $collection * @param array $settings * @param array $searchParams - * @param ?QueryResult $listedMetadata - * @param ?QueryResult $indexedMetadata + * @param ?QueryResultInterface $listedMetadata + * @param ?QueryResultInterface $indexedMetadata * * @return SolrSearch */ - public function findSolrByCollection(Collection $collection, array $settings, array $searchParams, ?QueryResult $listedMetadata = null, ?QueryResult $indexedMetadata = null) - { + public function findSolrByCollection( + Collection $collection, + array $settings, + array $searchParams, + ?QueryResultInterface $listedMetadata = null, + ?QueryResultInterface $indexedMetadata = null + ) { return $this->findSolr([$collection], $settings, $searchParams, $listedMetadata, $indexedMetadata); } @@ -606,13 +608,18 @@ public function findSolrByCollection(Collection $collection, array $settings, ar * @param array|QueryResultInterface $collections * @param array $settings * @param array $searchParams - * @param ?QueryResult $listedMetadata - * @param ?QueryResult $indexedMetadata + * @param ?QueryResultInterface $listedMetadata + * @param ?QueryResultInterface $indexedMetadata * * @return SolrSearch */ - public function findSolrByCollections(array|QueryResultInterface $collections, array $settings, array $searchParams, ?QueryResult $listedMetadata = null, ?QueryResult $indexedMetadata = null): SolrSearch - { + public function findSolrByCollections( + array|QueryResultInterface $collections, + array $settings, + array $searchParams, + ?QueryResultInterface $listedMetadata = null, + ?QueryResultInterface $indexedMetadata = null + ): SolrSearch { return $this->findSolr($collections, $settings, $searchParams, $listedMetadata, $indexedMetadata); } @@ -623,13 +630,17 @@ public function findSolrByCollections(array|QueryResultInterface $collections, a * * @param array $settings * @param array $searchParams - * @param ?QueryResult $listedMetadata - * @param ?QueryResult $indexedMetadata + * @param ?QueryResultInterface $listedMetadata + * @param ?QueryResultInterface $indexedMetadata * * @return SolrSearch */ - public function findSolrWithoutCollection(array $settings, array $searchParams, ?QueryResult $listedMetadata = null, ?QueryResult $indexedMetadata = null): SolrSearch - { + public function findSolrWithoutCollection( + array $settings, + array $searchParams, + ?QueryResultInterface $listedMetadata = null, + ?QueryResultInterface $indexedMetadata = null + ): SolrSearch { return $this->findSolr([], $settings, $searchParams, $listedMetadata, $indexedMetadata); } @@ -641,13 +652,18 @@ public function findSolrWithoutCollection(array $settings, array $searchParams, * @param array|QueryResultInterface $collections * @param array $settings * @param array $searchParams - * @param ?QueryResult $listedMetadata - * @param ?QueryResult $indexedMetadata + * @param ?QueryResultInterface $listedMetadata + * @param ?QueryResultInterface $indexedMetadata * * @return SolrSearch */ - private function findSolr(array|QueryResultInterface $collections, array $settings, array $searchParams, ?QueryResult $listedMetadata = null, ?QueryResult $indexedMetadata = null): SolrSearch - { + private function findSolr( + array|QueryResultInterface $collections, + array $settings, + array $searchParams, + ?QueryResultInterface $listedMetadata = null, + ?QueryResultInterface $indexedMetadata = null + ): SolrSearch { // set settings global inside this repository // (may be necessary when SolrSearch calls back) $this->settings = $settings; @@ -669,7 +685,7 @@ private function findSolr(array|QueryResultInterface $collections, array $settin */ public function getPreviousDocumentUid(int $uid): ?int { - $currentDocument = $this->findOneByUid($uid); + $currentDocument = $this->findOneBy([ 'uid' => $uid ]); if ($currentDocument) { $parentId = $currentDocument->getPartof(); @@ -719,7 +735,7 @@ public function getPreviousDocumentUid(int $uid): ?int */ public function getNextDocumentUid(int $uid): ?int { - $currentDocument = $this->findOneByUid($uid); + $currentDocument = $this->findOneBy([ 'uid' => $uid ]); if ($currentDocument) { $parentId = $currentDocument->getPartof(); diff --git a/Classes/Domain/Repository/FormatRepository.php b/Classes/Domain/Repository/FormatRepository.php index ed4d65ba62..2089f68f45 100644 --- a/Classes/Domain/Repository/FormatRepository.php +++ b/Classes/Domain/Repository/FormatRepository.php @@ -22,8 +22,6 @@ * @subpackage dlf * * @access public - * - * @method Format|null findOneByType(string $type) Get a format by its type */ class FormatRepository extends Repository { diff --git a/Classes/Domain/Repository/LibraryRepository.php b/Classes/Domain/Repository/LibraryRepository.php index 7ee050095e..cddce2ae91 100644 --- a/Classes/Domain/Repository/LibraryRepository.php +++ b/Classes/Domain/Repository/LibraryRepository.php @@ -24,7 +24,7 @@ * @access public * * @method Library|null findByUid(int|null $uid) Get a library by its UID - * @method Library|null findOneByIndexName(string $indexName) Get a library by its index name + * @method Library|null findOneBy(array $criteria) Get a library by criteria */ class LibraryRepository extends Repository { diff --git a/Classes/Domain/Repository/MetadataRepository.php b/Classes/Domain/Repository/MetadataRepository.php index cd7d6db92e..69f447f02b 100644 --- a/Classes/Domain/Repository/MetadataRepository.php +++ b/Classes/Domain/Repository/MetadataRepository.php @@ -24,11 +24,6 @@ * @subpackage dlf * * @access public - * - * @method int countByPid(int $uid) Count amount of metadata for given PID - * @method QueryResult findByIsListed(bool $isListed) Get a metadata which is listed or not listed - * @method QueryResult findByIndexIndexed(bool $indexIndexed) Get a metadata which is indexed or not indexed - * @method QueryResult findByIsSortable(bool $isSortable) Get a metadata which is sortable or not sortable */ class MetadataRepository extends Repository { diff --git a/Classes/Domain/Repository/PrinterRepository.php b/Classes/Domain/Repository/PrinterRepository.php index cfc8528c11..7ce7cb8583 100644 --- a/Classes/Domain/Repository/PrinterRepository.php +++ b/Classes/Domain/Repository/PrinterRepository.php @@ -23,7 +23,7 @@ * * @access public * - * @method Printer|null findOneByUid(int $uid) Get a printer by its UID + * @method Printer|null findOneBy(array $criteria) Get a printer by criteria */ class PrinterRepository extends Repository { diff --git a/Classes/Domain/Repository/SolrCoreRepository.php b/Classes/Domain/Repository/SolrCoreRepository.php index 3c27b99358..cf4d316575 100644 --- a/Classes/Domain/Repository/SolrCoreRepository.php +++ b/Classes/Domain/Repository/SolrCoreRepository.php @@ -22,9 +22,6 @@ * @subpackage dlf * * @access public - * - * @method int countByPid(int $uid) Count amount of SOLR cores for given PID - * @method SolrCore|null findOneByPid(int $uid) Get a SOLR core by its PID */ class SolrCoreRepository extends Repository { diff --git a/Classes/Domain/Repository/StructureRepository.php b/Classes/Domain/Repository/StructureRepository.php index f71fdc0780..e9129afe7a 100644 --- a/Classes/Domain/Repository/StructureRepository.php +++ b/Classes/Domain/Repository/StructureRepository.php @@ -23,8 +23,7 @@ * * @access public * - * @method int countByPid(int $uid) Count amount of structures for given PID - * @method Structure|null findOneByIndexName(string $indexName) Get a structure by its index name + * @method Structure|null findOneBy(array $criteria) Get a structure by criteria */ class StructureRepository extends Repository { diff --git a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php index 1a38ef4d3a..80835de9dd 100644 --- a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php +++ b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php @@ -175,7 +175,7 @@ protected function loadDocument(array $requestData, int $pid): void if ($doc !== null) { if ($doc->recordId) { - $this->document = $this->documentRepository->findOneByRecordId($doc->recordId); + $this->document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); } if (!isset($this->document)) { // create new dummy Document object @@ -190,7 +190,7 @@ protected function loadDocument(array $requestData, int $pid): void $this->document->setCurrentDocument($doc); } } elseif (!empty($requestData['recordId'])) { - $this->document = $this->documentRepository->findOneByRecordId($requestData['recordId']); + $this->document = $this->documentRepository->findOneBy([ 'recordId' => $requestData['recordId'] ]); if ($this->document !== null) { $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid]); if ($doc !== null) { From edb493b9238bb712bbb7f5444b96fcbea7e2094a Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 20 Aug 2025 14:57:31 +0200 Subject: [PATCH 061/111] Fix codestyle issues. --- Classes/Common/TypoScriptHelper.php | 6 +++--- Classes/Domain/Repository/BasketRepository.php | 2 +- Tests/Functional/Api/OaiPmhTypo3Client.php | 3 +-- Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index bd1c9affe4..05472652fc 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -45,8 +45,8 @@ public function __construct( private readonly IncludeTreeTraverser $includeTreeTraverser, private readonly ConditionVerdictAwareIncludeTreeTraverser $includeConditionVerdictAware, private readonly SysTemplateRepository $sysTemplateRepository, - ) - { + ) { + // empty } /** @@ -127,7 +127,7 @@ public static function getTyposcriptConfigV12(int $pid): array $typoScriptFrontendController->rootLine = $rootLine; $request = new ServerRequest(); $request = $typoScriptFrontendController->getFromCache($request); - + return $request->getAttribute('frontend.typoscript')->getSetupArray(); } diff --git a/Classes/Domain/Repository/BasketRepository.php b/Classes/Domain/Repository/BasketRepository.php index cbc3396f7b..489aeaa648 100644 --- a/Classes/Domain/Repository/BasketRepository.php +++ b/Classes/Domain/Repository/BasketRepository.php @@ -22,7 +22,7 @@ * @subpackage dlf * * @access public - * + * * @method Basket|null findOneBy(array $criteria) Get a basket by criteria */ class BasketRepository extends Repository diff --git a/Tests/Functional/Api/OaiPmhTypo3Client.php b/Tests/Functional/Api/OaiPmhTypo3Client.php index 75cbd49b3c..97c8dc03d1 100644 --- a/Tests/Functional/Api/OaiPmhTypo3Client.php +++ b/Tests/Functional/Api/OaiPmhTypo3Client.php @@ -62,8 +62,7 @@ public function __construct( int $pageId, FunctionalTestCase $functionalTestCase, bool $throwError = true - ) - { + ) { $this->baseUrl = $baseUrl; $this->pageId = $pageId; $this->functionalTestCase = $functionalTestCase; diff --git a/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php b/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php index 7801e5dea3..8fa7718b63 100644 --- a/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php @@ -37,7 +37,7 @@ public function renderWithStdWrap(): void $request = new ServerRequest(); $request = $request->withAttribute("currentContentObject", $cObj); - + $view = new StandaloneView(); $view->setRequest($request); From 734be4afe0530f045ea3b65390eaf2a8ff0fb31a Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 21 Aug 2025 11:28:41 +0200 Subject: [PATCH 062/111] Ignore phpcs error about escaping which does not apply here. --- Tests/Functional/Api/OaiPmhTypo3Client.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/Functional/Api/OaiPmhTypo3Client.php b/Tests/Functional/Api/OaiPmhTypo3Client.php index 97c8dc03d1..2ffeaf4621 100644 --- a/Tests/Functional/Api/OaiPmhTypo3Client.php +++ b/Tests/Functional/Api/OaiPmhTypo3Client.php @@ -89,13 +89,16 @@ public function request($verb, array $params = []) try { $xml = new SimpleXMLElement((string) $response->getBody()); } catch (Exception $e) { + // ignore phpcs error "All output should be run through an escaping function, see WordPress security" + // phpcs:ignore throw new MalformedResponseException(sprintf("Could not decode XML Response: %s", $e->getMessage())); } if ($this->throwError && isset($xml->error)) { $code = (string) $xml->error['code']; $msg = (string) $xml->error; - + // ignore phpcs error "All output should be run through an escaping function, see WordPress security" + // phpcs:ignore throw new OaipmhException($code, $msg); } From d1514173bcecaeb82a597cf72cf23d0b3464a544 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 23 Aug 2025 11:35:24 +0200 Subject: [PATCH 063/111] Fix call to protected PageRepository::getRecordOverlay for Typo3 v13 update. --- Classes/Common/Helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index 563ce93204..81e46dc48d 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -809,7 +809,7 @@ public static function translate(string $indexName, string $table, string $pid): while ($resArray = $result->fetchAssociative()) { // Overlay localized labels if available. if ($languageContentId > 0) { - $resArray = $pageRepository->getRecordOverlay($table, $resArray, $languageContentId, $languageAspect->getLegacyOverlayType()); + $resArray = $pageRepository->getLanguageOverlay($table, $resArray, $languageAspect); } if ($resArray) { $labels[$table][$pid][$languageContentId][$resArray['index_name']] = $resArray['label']; From cf5e3ba32c68ca60f7a0a6debaa26591ec6b8cbf Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Sat, 23 Aug 2025 13:50:12 +0200 Subject: [PATCH 064/111] Migrate custom upgrade wizards to use service tags for Typo3 v13 update. --- Classes/Updates/FileLocationUpdater.php | 12 ++---------- Classes/Updates/FormatUpdater.php | 15 ++------------- Classes/Updates/MigrateSettings.php | 16 ++-------------- Classes/Updates/UpdateSolrSchema.php | 16 ++-------------- ext_localconf.php | 11 ----------- 5 files changed, 8 insertions(+), 62 deletions(-) diff --git a/Classes/Updates/FileLocationUpdater.php b/Classes/Updates/FileLocationUpdater.php index 9f62221704..8de87519c7 100644 --- a/Classes/Updates/FileLocationUpdater.php +++ b/Classes/Updates/FileLocationUpdater.php @@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Resource\ResourceStorage; use TYPO3\CMS\Core\Resource\StorageRepository; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; use TYPO3\CMS\Install\Updates\ChattyInterface; @@ -34,6 +35,7 @@ * * @access public */ +#[UpgradeWizard('fileLocationUpdater')] class FileLocationUpdater implements UpgradeWizardInterface, ChattyInterface, LoggerAwareInterface { use LoggerAwareTrait; @@ -58,16 +60,6 @@ class FileLocationUpdater implements UpgradeWizardInterface, ChattyInterface, Lo 'tx_dlf_collections' => 'thumbnail' ]; - /** - * @access public - * - * @return string Unique identifier of this updater - */ - public function getIdentifier(): string - { - return self::class; - } - /** * Return the speaking name of this wizard * diff --git a/Classes/Updates/FormatUpdater.php b/Classes/Updates/FormatUpdater.php index 1011ff0e54..466ad5f927 100644 --- a/Classes/Updates/FormatUpdater.php +++ b/Classes/Updates/FormatUpdater.php @@ -19,6 +19,7 @@ use Symfony\Component\Console\Output\OutputInterface; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\ChattyInterface; use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; @@ -31,6 +32,7 @@ * * @access public */ +#[UpgradeWizard('formatUpdater')] class FormatUpdater implements UpgradeWizardInterface, ChattyInterface, LoggerAwareInterface { use LoggerAwareTrait; @@ -47,19 +49,6 @@ class FormatUpdater implements UpgradeWizardInterface, ChattyInterface, LoggerAw */ protected OutputInterface $output; - /** - * Return the identifier for this wizard - * This should be the same string as used in the ext_localconf class registration - * - * @access public - * - * @return string Unique identifier of this updater - */ - public function getIdentifier(): string - { - return self::class; - } - /** * Return the speaking name of this wizard * diff --git a/Classes/Updates/MigrateSettings.php b/Classes/Updates/MigrateSettings.php index 317c646e4d..ad1d362b2d 100644 --- a/Classes/Updates/MigrateSettings.php +++ b/Classes/Updates/MigrateSettings.php @@ -15,6 +15,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; @@ -26,22 +27,9 @@ * * @internal */ +#[UpgradeWizard('migrateSettings')] class MigrateSettings implements UpgradeWizardInterface { - - /** - * Return the identifier for this wizard - * This should be the same string as used in the ext_localconf class registration - * - * @access public - * - * @return string - */ - public function getIdentifier(): string - { - return self::class; - } - /** * Return the speaking name of this wizard * diff --git a/Classes/Updates/UpdateSolrSchema.php b/Classes/Updates/UpdateSolrSchema.php index cf6d2c70a0..6f47c81529 100644 --- a/Classes/Updates/UpdateSolrSchema.php +++ b/Classes/Updates/UpdateSolrSchema.php @@ -16,6 +16,7 @@ use Solarium\Core\Client\Request; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; @@ -27,22 +28,9 @@ * * @internal */ +#[UpgradeWizard('updateSolrSchema')] class UpdateSolrSchema implements UpgradeWizardInterface { - - /** - * Return the identifier for this wizard - * This should be the same string as used in the ext_localconf class registration - * - * @access public - * - * @return string - */ - public function getIdentifier(): string - { - return self::class; - } - /** * Return the speaking name of this wizard * diff --git a/ext_localconf.php b/ext_localconf.php index 6d79f09534..0da6d96bb9 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -146,17 +146,6 @@ 'class' => \Kitodo\Dlf\Hooks\Form\FieldInformation\SolrCoreStatus::class ]; - -// Add migration wizards -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\Kitodo\Dlf\Updates\MigrateSettings::class] - = \Kitodo\Dlf\Updates\MigrateSettings::class; -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\Kitodo\Dlf\Updates\FileLocationUpdater::class] - = \Kitodo\Dlf\Updates\FileLocationUpdater::class; -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\Kitodo\Dlf\Updates\FormatUpdater::class] - = \Kitodo\Dlf\Updates\FormatUpdater::class; -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][\Kitodo\Dlf\Updates\UpdateSolrSchema::class] -= \Kitodo\Dlf\Updates\UpdateSolrSchema::class; - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Dlf', 'Search', From 958060423f38786bf352aedc41830a3bab5f4018 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 25 Aug 2025 18:33:25 +0200 Subject: [PATCH 065/111] Fix TypoScriptHelper not releasing locks for Typo3 v13 update. --- Classes/Common/TypoScriptHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index 05472652fc..b2ab457210 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -127,6 +127,7 @@ public static function getTyposcriptConfigV12(int $pid): array $typoScriptFrontendController->rootLine = $rootLine; $request = new ServerRequest(); $request = $typoScriptFrontendController->getFromCache($request); + $typoScriptFrontendController->releaseLocks(); return $request->getAttribute('frontend.typoscript')->getSetupArray(); } From a41da8e999613f325e13d2515fe7e67abd115715 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 10:51:25 +0200 Subject: [PATCH 066/111] Use custom versions of ubl/php-iiif-prezi-reader with PHP 8.1 and 8.2+ support for Typo3 v13 update. --- Classes/Common/IiifManifest.php | 2 ++ composer.json | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Classes/Common/IiifManifest.php b/Classes/Common/IiifManifest.php index 26db627485..bacb062694 100644 --- a/Classes/Common/IiifManifest.php +++ b/Classes/Common/IiifManifest.php @@ -499,6 +499,7 @@ public function getManifestMetadata(string $id, bool $withDescription = true, bo if (!empty($this->originalMetadataArray[$id])) { return $this->originalMetadataArray[$id]; } + /** @var IiifResourceInterface $iiifResource */ $iiifResource = $this->iiif->getContainedResourceById($id); $result = []; if ($iiifResource != null) { @@ -713,6 +714,7 @@ public function getFullText(string $id): string } } if ($this->getIndexAnnotations() == 1) { + /** @var IiifResourceInterface $iiifResource */ $iiifResource = $this->iiif->getContainedResourceById($id); // Get annotation containers $annotationContainerIds = $physicalStructureNode['annotationContainers']; diff --git a/composer.json b/composer.json index ee02d9b2d8..c2a6493104 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "typo3/cms-tstemplate": "^12.4|^13.4", "caseyamcl/phpoaipmh": "^3.3", "slub/php-mods-reader": "^0.4", - "ubl/php-iiif-prezi-reader": "0.3", + "ubl/php-iiif-prezi-reader": "0.3.1|0.3.2", "solarium/solarium": "^6.3", "softcreatr/jsonpath": "^0.10", "symfony/process": "^6.4|^7.3" @@ -127,5 +127,11 @@ "typo3/class-alias-loader": true, "typo3/cms-composer-installers": true } - } + }, + "repositories": [ + { + "type": "github", + "url": "https://github.com/kitodo/php-iiif-prezi-reader.git" + } + ] } From 352881033b4fc062d69c0c9b80378faa078518c3 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 11:39:19 +0200 Subject: [PATCH 067/111] Run phpstan in CI with both Typo3 v12 and v13. --- .github/workflows/phpstan.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index a5ab654c19..39a7d45bb6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -10,6 +10,9 @@ jobs: phpstan: name: Static Code Analysis runs-on: ubuntu-latest + strategy: + matrix: + variants: [ {typo3: 12.4, php: 8.1}, {typo3: 13.4, php: 8.4} ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -17,7 +20,9 @@ jobs: - name: Install dependencies uses: php-actions/composer@v6 with: - command: update --ignore-platform-reqs + command: update + php_version: ${{ matrix.variants.php }} + args: --ignore-platform-reqs --with=typo3/cms-core:^${{ matrix.variants.typo3 }} - name: PHPStan Static Analysis uses: php-actions/phpstan@v3 From 1579c235c79424a00b7d3cd691680edf56bd837f Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 12:31:16 +0200 Subject: [PATCH 068/111] Use different phpstan config depending on Typo3 version. --- .github/phpstan_12.4.neon | 21 +++++++++++++++++++++ .github/{phpstan.neon => phpstan_13.4.neon} | 6 ++++++ .github/workflows/phpstan.yml | 2 +- composer.json | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/phpstan_12.4.neon rename .github/{phpstan.neon => phpstan_13.4.neon} (58%) diff --git a/.github/phpstan_12.4.neon b/.github/phpstan_12.4.neon new file mode 100644 index 0000000000..e5c5ed9134 --- /dev/null +++ b/.github/phpstan_12.4.neon @@ -0,0 +1,21 @@ +parameters: + ignoreErrors: + - '#Call to an undefined method Psr\\Http\\Message\\RequestFactoryInterface::request\(\)\.#' + - '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\ManifestInterface::getOriginalJsonArray\(\)\.#' + - '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\RangeInterface::getMemberRangesAndRanges\(\)\.#' + - + message: '#Class TYPO3\\CMS\\Core\\TypoScript\\FrontendTypoScriptFactory not found\.#' + path: ../Classes/Common/TypoScriptHelper.php + - + message: '#Call to method createSettingsAndSetupConditions\(\) on an unknown class TYPO3\\CMS\\Core\\TypoScript\\FrontendTypoScriptFactory\.#' + path: ../Classes/Common/TypoScriptHelper.php + - + message: '#Call to method createSetupConfigOrFullSetup\(\) on an unknown class TYPO3\\CMS\\Core\\TypoScript\\FrontendTypoScriptFactory\.#' + path: ../Classes/Common/TypoScriptHelper.php + level: 5 + paths: + - ../Classes/ + excludePaths: + - ../Classes/Controller/OaiPmhController.php + - ../Classes/Command/DbDocs/Generator.php # dbdocs command is not supported in Typo3 v12 + treatPhpDocTypesAsCertain: false diff --git a/.github/phpstan.neon b/.github/phpstan_13.4.neon similarity index 58% rename from .github/phpstan.neon rename to .github/phpstan_13.4.neon index 9d2e14f8af..4f7401717d 100644 --- a/.github/phpstan.neon +++ b/.github/phpstan_13.4.neon @@ -3,6 +3,12 @@ parameters: - '#Call to an undefined method Psr\\Http\\Message\\RequestFactoryInterface::request\(\)\.#' - '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\ManifestInterface::getOriginalJsonArray\(\)\.#' - '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\RangeInterface::getMemberRangesAndRanges\(\)\.#' + - + message: '#Call to an undefined method TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController::getFromCache\(\)\.#' + path: ../Classes/Common/TypoScriptHelper.php + - + message: '#Call to an undefined method TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController::releaseLocks\(\)\.#' + path: ../Classes/Common/TypoScriptHelper.php level: 5 paths: - ../Classes/ diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 39a7d45bb6..89d0fc72f6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -27,5 +27,5 @@ jobs: - name: PHPStan Static Analysis uses: php-actions/phpstan@v3 with: - configuration: ./.github/phpstan.neon + configuration: ./.github/phpstan_${{ matrix.variants.typo3 }}.neon path: '' diff --git a/composer.json b/composer.json index c2a6493104..5d737613e1 100644 --- a/composer.json +++ b/composer.json @@ -119,7 +119,7 @@ "@composer docs:start" ], "phpstan": [ - "@php vendor/bin/phpstan --configuration=\".github/phpstan.neon\"" + "@php vendor/bin/phpstan --configuration=\".github/phpstan_13.4.neon\"" ] }, "config": { From 745ddf427279b031ff2c3f7b55fce7272be0a616 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 12:31:42 +0200 Subject: [PATCH 069/111] Update mail API in BasketController for Typo3 v13 update. --- Classes/Controller/BasketController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index 71dad00d20..5ad50610c1 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -20,6 +20,7 @@ use Kitodo\Dlf\Domain\Repository\BasketRepository; use Kitodo\Dlf\Domain\Repository\PrinterRepository; use Psr\Http\Message\ResponseInterface; +use Symfony\Component\Mime\Address; use TYPO3\CMS\Core\Mail\MailMessage; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MailUtility; @@ -590,12 +591,12 @@ protected function sendMail(): void // Prepare and send the message $mail // subject - ->setSubject(LocalizationUtility::translate('basket.mailSubject', 'dlf')) + ->subject(LocalizationUtility::translate('basket.mailSubject', 'dlf')) // Set the From address with an associative array ->setFrom($from) // Set the To addresses with an associative array - ->setTo([$mailObject->getMail() => $mailObject->getName()]) - ->setBody($mailBody, 'text/html') + ->to(new Address($mailObject->getMail(), $mailObject->getName())) + ->html($mailBody) ->send(); // create entry for action log From a591efed954d72318b22d96db8eb2ed5df07e9c8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 12:32:50 +0200 Subject: [PATCH 070/111] Restrict dbdocs command to only run with Typo3 v13 due to heavy Typo3 internal API use. --- Classes/Command/DbDocsCommand.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Classes/Command/DbDocsCommand.php b/Classes/Command/DbDocsCommand.php index 55ad1339ae..2569f3fd9c 100644 --- a/Classes/Command/DbDocsCommand.php +++ b/Classes/Command/DbDocsCommand.php @@ -12,18 +12,15 @@ namespace Kitodo\Dlf\Command; -use Kitodo\Dlf\Common\AbstractDocument; -use Kitodo\Dlf\Common\Indexer; use Kitodo\Dlf\Command\DbDocs\Generator; -use Kitodo\Dlf\Domain\Model\Document; +use RuntimeException; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\MathUtility; /** * CLI Command for generating the reStructuredText file containing documentation @@ -81,6 +78,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $outputPath = $input->getArgument('outputPath'); } + $typo3Version = (new Typo3Version())->getMajorVersion(); + if ($typo3Version != 13) { + throw new RuntimeException(("dbdocs command can only be run with Typo3 v13")); + } + $tables = $this->generator->collectTables(); $page = $this->generator->generatePage($tables); From cbaf7d4a3c606edd847cc5b61238df3d29c8feef Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 12:33:40 +0200 Subject: [PATCH 071/111] Fix db schema parser call for dbdocs command for Typo3 v13 update. --- Classes/Command/DbDocs/Generator.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/Command/DbDocs/Generator.php b/Classes/Command/DbDocs/Generator.php index 5d3255ef07..17503e40d8 100644 --- a/Classes/Command/DbDocs/Generator.php +++ b/Classes/Command/DbDocs/Generator.php @@ -13,18 +13,18 @@ namespace Kitodo\Dlf\Command\DbDocs; use Doctrine\DBAL\Schema\Table; -use Kitodo\Dlf\Common\Helper; use ReflectionClass; use ReflectionProperty; +use RuntimeException; +use TYPO3\CMS\Core\Database\Schema\Parser\Lexer; use TYPO3\CMS\Core\Database\Schema\Parser\Parser; use TYPO3\CMS\Core\Database\Schema\SqlReader; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Localization\LanguageServiceFactory; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; -use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Persistence\ClassesConfiguration; -use TYPO3\CMS\Extbase\Persistence\ClassesConfigurationFactory; use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory; use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper; @@ -101,8 +101,8 @@ public function collectTables(): array $result = []; foreach ($createTableStatements as $statement) { - $parser = new Parser($statement); - list($table) = $parser->parse(); + $parser = new Parser(new Lexer()); + list($table) = $parser->parse($statement); $tableName = $table->getName(); if (!str_starts_with($tableName, 'tx_dlf_')) { From 179f3cbe3d916aa7743cae6f8f609eaa32d88641 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 12:35:09 +0200 Subject: [PATCH 072/111] Remove phpstan ignore comments in TypoScriptHelper.php which are now covered by Typo3 specific phpstan config files. --- Classes/Common/TypoScriptHelper.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Classes/Common/TypoScriptHelper.php b/Classes/Common/TypoScriptHelper.php index b2ab457210..2a010e1a15 100644 --- a/Classes/Common/TypoScriptHelper.php +++ b/Classes/Common/TypoScriptHelper.php @@ -14,8 +14,6 @@ use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\DependencyInjection\Attribute\Autowire; -use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Information\Typo3Version; @@ -29,7 +27,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\RootlineUtility; use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; -use TYPO3\CMS\Frontend\Page\PageInformation; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** @@ -67,7 +64,6 @@ public function getTyposcriptConfigV13(int $pid): array $sysTemplateRows = $this->sysTemplateRepository->getSysTemplateRowsByRootline($rootLine); $frontendTypoScriptFactory = GeneralUtility::makeInstance( - // @phpstan-ignore-next-line (class does not exist in Typo3 v12) \TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory::class, $this->container, $this->eventDispatcher, @@ -77,7 +73,6 @@ public function getTyposcriptConfigV13(int $pid): array $this->includeConditionVerdictAware, ); - // @phpstan-ignore-next-line ($frontendTypoScriptFactory does not exist in Typo3 v12) $frontendTypoScript = $frontendTypoScriptFactory->createSettingsAndSetupConditions( $site, $sysTemplateRows, @@ -85,7 +80,6 @@ public function getTyposcriptConfigV13(int $pid): array null, ); - // @phpstan-ignore-next-line ($frontendTypoScriptFactory does not exist in Typo3 v12) $ts = $frontendTypoScriptFactory->createSetupConfigOrFullSetup( true, $frontendTypoScript, From d09c4287e842fdd3fc7cff3e1ef691aa2bbeb8ec Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 13:26:15 +0200 Subject: [PATCH 073/111] Migrate scheduler action class changed to enum in Typo3 v13. --- .github/phpstan_12.4.neon | 6 ++++ .github/phpstan_13.4.neon | 9 ++++++ Classes/Task/BaseAdditionalFieldProvider.php | 29 +++++++++++++++++++ .../Task/DeleteAdditionalFieldProvider.php | 6 +--- .../Task/HarvestAdditionalFieldProvider.php | 5 +--- Classes/Task/IndexAdditionalFieldProvider.php | 6 +--- .../Task/OptimizeAdditionalFieldProvider.php | 8 +---- .../Task/ReindexAdditionalFieldProvider.php | 5 +--- .../SuggestBuildAdditionalFieldProvider.php | 8 +---- 9 files changed, 50 insertions(+), 32 deletions(-) diff --git a/.github/phpstan_12.4.neon b/.github/phpstan_12.4.neon index e5c5ed9134..d5e27f3605 100644 --- a/.github/phpstan_12.4.neon +++ b/.github/phpstan_12.4.neon @@ -12,6 +12,12 @@ parameters: - message: '#Call to method createSetupConfigOrFullSetup\(\) on an unknown class TYPO3\\CMS\\Core\\TypoScript\\FrontendTypoScriptFactory\.#' path: ../Classes/Common/TypoScriptHelper.php + - + message: '#PHPDoc tag @var for variable \$action contains unknown class TYPO3\\CMS\\Scheduler\\SchedulerManagementAction\.#' + path: ../Classes/Task/BaseAdditionalFieldProvider.php + - + message: '#Access to constant EDIT on an unknown class TYPO3\\CMS\\Scheduler\\SchedulerManagementAction\.#' + path: ../Classes/Task/BaseAdditionalFieldProvider.php level: 5 paths: - ../Classes/ diff --git a/.github/phpstan_13.4.neon b/.github/phpstan_13.4.neon index 4f7401717d..cd760e5a80 100644 --- a/.github/phpstan_13.4.neon +++ b/.github/phpstan_13.4.neon @@ -9,6 +9,15 @@ parameters: - message: '#Call to an undefined method TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController::releaseLocks\(\)\.#' path: ../Classes/Common/TypoScriptHelper.php + - + message: '#PHPDoc tag @var for variable \$action contains unknown class TYPO3\\CMS\\Scheduler\\Task\\Enumeration\\Action\.#' + path: ../Classes/Task/BaseAdditionalFieldProvider.php + - + message: '#Access to constant EDIT on an unknown class TYPO3\\CMS\\Scheduler\\Task\\Enumeration\\Action\.#' + path: ../Classes/Task/BaseAdditionalFieldProvider.php + - + message: '#Call to method equals\(\) on an unknown class TYPO3\\CMS\\Scheduler\\Task\\Enumeration\\Action\.#' + path: ../Classes/Task/BaseAdditionalFieldProvider.php level: 5 paths: - ../Classes/ diff --git a/Classes/Task/BaseAdditionalFieldProvider.php b/Classes/Task/BaseAdditionalFieldProvider.php index b210e5e42c..176941c2bb 100644 --- a/Classes/Task/BaseAdditionalFieldProvider.php +++ b/Classes/Task/BaseAdditionalFieldProvider.php @@ -15,11 +15,14 @@ use TYPO3\CMS\Backend\Tree\Repository\PageTreeRepository; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; +use TYPO3\CMS\Scheduler\SchedulerManagementAction; use TYPO3\CMS\Scheduler\Task\AbstractTask; +use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Base class for additional fields classes of scheduler tasks. @@ -339,4 +342,30 @@ protected function getSoftCommitField(bool $softCommit): array 'cshLabel' => $fieldId ]; } + + /** + * Return whether the current action is an edit action. + * + * Between Typo3 v12 and v13 the action type has changed from a custom Typo3 class to an PHP enum, see: + * https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-101129-ConvertActionToNativeEnum.html + * + * @access protected + * + * @param SchedulerModuleController $schedulerModule scheduler module + * + * @return bool whether current action is an edit action + */ + protected function isEditAction(SchedulerModuleController $schedulerModule): bool + { + $typo3Version = (new Typo3Version())->getMajorVersion(); + if ($typo3Version == 12) { + /** @var \TYPO3\CMS\Scheduler\Task\Enumeration\Action $action */ + $action = $schedulerModule->getCurrentAction(); + return $action->equals(Action::EDIT); + } else { + /** @var \TYPO3\CMS\Scheduler\SchedulerManagementAction $action */ + $action = $schedulerModule->getCurrentAction(); + return $action === SchedulerManagementAction::EDIT; + } + } } diff --git a/Classes/Task/DeleteAdditionalFieldProvider.php b/Classes/Task/DeleteAdditionalFieldProvider.php index cc0605fcc8..3e32d5b4b8 100644 --- a/Classes/Task/DeleteAdditionalFieldProvider.php +++ b/Classes/Task/DeleteAdditionalFieldProvider.php @@ -12,8 +12,6 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; -use TYPO3\CMS\Scheduler\Task\AbstractTask; -use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Additional fields for index document task. @@ -35,10 +33,8 @@ class DeleteAdditionalFieldProvider extends BaseAdditionalFieldProvider */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { - $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); - /** @var BaseTask $task */ - if ($currentSchedulerModuleAction->equals(Action::EDIT)) { + if ($this->isEditAction($schedulerModule)) { $taskInfo['doc'] = $task->getDoc(); $taskInfo['pid'] = $task->getPid(); $taskInfo['solr'] = $task->getSolr(); diff --git a/Classes/Task/HarvestAdditionalFieldProvider.php b/Classes/Task/HarvestAdditionalFieldProvider.php index 18f04d22f4..085aae7638 100644 --- a/Classes/Task/HarvestAdditionalFieldProvider.php +++ b/Classes/Task/HarvestAdditionalFieldProvider.php @@ -15,7 +15,6 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; -use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Additional fields for harvest documents task. @@ -37,10 +36,8 @@ class HarvestAdditionalFieldProvider extends BaseAdditionalFieldProvider */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { - $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); - /** @var BaseTask $task */ - if ($currentSchedulerModuleAction->equals(Action::EDIT)) { + if ($this->isEditAction($schedulerModule)) { $taskInfo['dryRun'] = $task->isDryRun(); $taskInfo['lib'] = $task->getLib(); $taskInfo['pid'] = $task->getPid(); diff --git a/Classes/Task/IndexAdditionalFieldProvider.php b/Classes/Task/IndexAdditionalFieldProvider.php index 5d3b0b6fe0..eb5d9cd403 100644 --- a/Classes/Task/IndexAdditionalFieldProvider.php +++ b/Classes/Task/IndexAdditionalFieldProvider.php @@ -12,8 +12,6 @@ namespace Kitodo\Dlf\Task; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; -use TYPO3\CMS\Scheduler\Task\AbstractTask; -use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Additional fields for index document task. @@ -35,10 +33,8 @@ class IndexAdditionalFieldProvider extends BaseAdditionalFieldProvider */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { - $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); - /** @var BaseTask $task */ - if ($currentSchedulerModuleAction->equals(Action::EDIT)) { + if ($this->isEditAction($schedulerModule)) { $taskInfo['dryRun'] = $task->isDryRun(); $taskInfo['doc'] = $task->getDoc(); $taskInfo['pid'] = $task->getPid(); diff --git a/Classes/Task/OptimizeAdditionalFieldProvider.php b/Classes/Task/OptimizeAdditionalFieldProvider.php index b74dcaf9ed..1cb73478af 100644 --- a/Classes/Task/OptimizeAdditionalFieldProvider.php +++ b/Classes/Task/OptimizeAdditionalFieldProvider.php @@ -11,11 +11,7 @@ */ namespace Kitodo\Dlf\Task; -use TYPO3\CMS\Core\Database\Connection; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; -use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Additional fields for reindex documents task. @@ -37,10 +33,8 @@ class OptimizeAdditionalFieldProvider extends BaseAdditionalFieldProvider */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { - $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); - /** @var BaseTask $task */ - if ($currentSchedulerModuleAction->equals(Action::EDIT)) { + if ($this->isEditAction($schedulerModule)) { $taskInfo['solr'] = $task->getSolr(); $taskInfo['commit'] = $task->isCommit(); $taskInfo['optimize'] = $task->isOptimize(); diff --git a/Classes/Task/ReindexAdditionalFieldProvider.php b/Classes/Task/ReindexAdditionalFieldProvider.php index d6824ed82e..c3c68a2c6c 100644 --- a/Classes/Task/ReindexAdditionalFieldProvider.php +++ b/Classes/Task/ReindexAdditionalFieldProvider.php @@ -15,7 +15,6 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; -use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Additional fields for reindex documents task. @@ -37,10 +36,8 @@ class ReindexAdditionalFieldProvider extends BaseAdditionalFieldProvider */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { - $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); - /** @var BaseTask $task */ - if ($currentSchedulerModuleAction->equals(Action::EDIT)) { + if ($this->isEditAction($schedulerModule)) { $taskInfo['dryRun'] = $task->isDryRun(); $taskInfo['coll'] = $task->getColl(); $taskInfo['pid'] = $task->getPid(); diff --git a/Classes/Task/SuggestBuildAdditionalFieldProvider.php b/Classes/Task/SuggestBuildAdditionalFieldProvider.php index 1af7f61326..ce1799dfd2 100644 --- a/Classes/Task/SuggestBuildAdditionalFieldProvider.php +++ b/Classes/Task/SuggestBuildAdditionalFieldProvider.php @@ -11,11 +11,7 @@ */ namespace Kitodo\Dlf\Task; -use TYPO3\CMS\Core\Database\Connection; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; -use TYPO3\CMS\Scheduler\Task\Enumeration\Action; /** * Additional fields for building the suggestion dictionary task. @@ -37,10 +33,8 @@ class SuggestBuildAdditionalFieldProvider extends BaseAdditionalFieldProvider */ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { - $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); - /** @var BaseTask $task */ - if ($currentSchedulerModuleAction->equals(Action::EDIT)) { + if ($this->isEditAction($schedulerModule)) { $taskInfo['solr'] = $task->getSolr(); } else { $taskInfo['solr'] = - 1; From 9c254ac41f509bde5c6ce93f797c0c2e769312d5 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 13:34:03 +0200 Subject: [PATCH 074/111] Migrate PDO::PARAM_* to Connection::PARAM_* for Typo3 v13 update. --- Classes/Updates/FileLocationUpdater.php | 11 ++++++----- Classes/Updates/FormatUpdater.php | 3 ++- Classes/Updates/MigrateSettings.php | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Classes/Updates/FileLocationUpdater.php b/Classes/Updates/FileLocationUpdater.php index 8de87519c7..786bc722c1 100644 --- a/Classes/Updates/FileLocationUpdater.php +++ b/Classes/Updates/FileLocationUpdater.php @@ -17,6 +17,7 @@ use Psr\Log\LoggerAwareTrait; use Symfony\Component\Console\Output\OutputInterface; use TYPO3\CMS\Core\Core\Environment; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder; use TYPO3\CMS\Core\Resource\ResourceStorage; @@ -179,7 +180,7 @@ protected function getRecordsFromTable(bool $countOnly = false) $queryBuilder->expr()->isNotNull($this->fieldsToMigrate[$table]), $queryBuilder->expr()->neq( $this->fieldsToMigrate[$table], - $queryBuilder->createNamedParameter('', \PDO::PARAM_STR) + $queryBuilder->createNamedParameter('', Connection::PARAM_STR) ), $queryBuilder->expr()->comparison( 'CAST(CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS DECIMAL) AS CHAR)', @@ -275,15 +276,15 @@ protected function migrateField(string $table, array $row): void $existingFileRecord = $queryBuilder->select('uid')->from('sys_file')->where( $queryBuilder->expr()->eq( 'missing', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter(0, Connection::PARAM_INT) ), $queryBuilder->expr()->eq( 'sha1', - $queryBuilder->createNamedParameter($fileSha1, \PDO::PARAM_STR) + $queryBuilder->createNamedParameter($fileSha1, Connection::PARAM_STR) ), $queryBuilder->expr()->eq( 'storage', - $queryBuilder->createNamedParameter($storageUid, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($storageUid, Connection::PARAM_INT) ) )->executeQuery()->fetchAssociative(); @@ -317,7 +318,7 @@ protected function migrateField(string $table, array $row): void $queryBuilder->update($table)->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($row['uid'], Connection::PARAM_INT) ) )->set($this->fieldsToMigrate[$table], 1)->executeStatement(); } diff --git a/Classes/Updates/FormatUpdater.php b/Classes/Updates/FormatUpdater.php index 466ad5f927..3a820be30e 100644 --- a/Classes/Updates/FormatUpdater.php +++ b/Classes/Updates/FormatUpdater.php @@ -17,6 +17,7 @@ use Psr\Log\LoggerAwareTrait; use RuntimeException; use Symfony\Component\Console\Output\OutputInterface; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Install\Attribute\UpgradeWizard; @@ -239,7 +240,7 @@ protected function migrateField(array $row): void $queryBuilder->update($this->table)->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($row['uid'], Connection::PARAM_INT) ) )->set('pid', $result['pid'])->executeStatement(); } diff --git a/Classes/Updates/MigrateSettings.php b/Classes/Updates/MigrateSettings.php index ad1d362b2d..e53fe9344d 100644 --- a/Classes/Updates/MigrateSettings.php +++ b/Classes/Updates/MigrateSettings.php @@ -12,6 +12,7 @@ namespace Kitodo\Dlf\Updates; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -88,7 +89,7 @@ public function executeUpdate(): bool ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($record['uid'], Connection::PARAM_INT) ) ) ->set('pi_flexform', $this->migrateFlexFormSettings($record['pi_flexform'])) From 5205afcd56a6716475e669e8583adaaf3b39aa34 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 26 Aug 2025 16:47:43 +0200 Subject: [PATCH 075/111] Update BasketController and replace deprecated GLOBALS['TSFE'] with request attribute for Typo3 v13 update. --- Classes/Controller/BasketController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index 5ad50610c1..5c2b4bd941 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -240,17 +240,18 @@ public function mainAction(): ResponseInterface protected function getBasketData(): Basket { // get user session - $userSession = $GLOBALS['TSFE']->fe_user->getSession(); + $fe_user = $this->request->getAttribute('frontend.user'); + $userSession = $fe_user->getSession(); // Checking if a user is logged in $userIsLoggedIn = $this->isUserLoggedIn(); if ($userIsLoggedIn) { - $basket = $this->basketRepository->findOneBy([ 'feUserId' => (int) $GLOBALS['TSFE']->fe_user->user['uid'] ]); + $basket = $this->basketRepository->findOneBy([ 'feUserId' => (int) $fe_user->getUserId() ]); } else { $userSession->set('ses', 'tx_dlf_basket', ''); $userSession->dataWasUpdated(); - $GLOBALS['TSFE']->fe_user->storeSessionData(); + $fe_user->storeSessionData(); $basket = $this->basketRepository->findOneBy([ 'sessionId' => $userSession->getIdentifier() ]); } @@ -260,7 +261,7 @@ protected function getBasketData(): Basket // create new basket in db $basket = GeneralUtility::makeInstance(Basket::class); $basket->setSessionId($userSession->getIdentifier()); - $basket->setFeUserId($userIsLoggedIn ? $GLOBALS['TSFE']->fe_user->user['uid'] : 0); + $basket->setFeUserId($userIsLoggedIn ? $fe_user->getUserId() : 0); } return $basket; From bb03409697cdc3c8ce0d209a1ce78dae31bb9e5e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 27 Aug 2025 20:33:29 +0200 Subject: [PATCH 076/111] Fix code style issue in BasketController.php. --- Classes/Controller/BasketController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index 5c2b4bd941..d8d3c7e4fd 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -240,18 +240,18 @@ public function mainAction(): ResponseInterface protected function getBasketData(): Basket { // get user session - $fe_user = $this->request->getAttribute('frontend.user'); - $userSession = $fe_user->getSession(); + $feUser = $this->request->getAttribute('frontend.user'); + $userSession = $feUser->getSession(); // Checking if a user is logged in $userIsLoggedIn = $this->isUserLoggedIn(); if ($userIsLoggedIn) { - $basket = $this->basketRepository->findOneBy([ 'feUserId' => (int) $fe_user->getUserId() ]); + $basket = $this->basketRepository->findOneBy([ 'feUserId' => (int) $feUser->getUserId() ]); } else { $userSession->set('ses', 'tx_dlf_basket', ''); $userSession->dataWasUpdated(); - $fe_user->storeSessionData(); + $feUser->storeSessionData(); $basket = $this->basketRepository->findOneBy([ 'sessionId' => $userSession->getIdentifier() ]); } @@ -261,7 +261,7 @@ protected function getBasketData(): Basket // create new basket in db $basket = GeneralUtility::makeInstance(Basket::class); $basket->setSessionId($userSession->getIdentifier()); - $basket->setFeUserId($userIsLoggedIn ? $fe_user->getUserId() : 0); + $basket->setFeUserId($userIsLoggedIn ? $feUser->getUserId() : 0); } return $basket; From ebad0256cc3f7b9ab115116b053daf9d3586dbe3 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:09 +0200 Subject: [PATCH 077/111] Update Classes/Command/BaseCommand.php --- Classes/Command/BaseCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index e57bfe8d2a..3de165604a 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -226,7 +226,7 @@ protected function saveToDatabase(Document $document, bool $softCommit = false): $document->setMetsLabel($metadata['mets_label'][0] ?? ''); $document->setMetsOrderlabel($metadata['mets_orderlabel'][0] ?? ''); - $structure = $this->structureRepository->findOneBy([ 'indexName' => $metadata['type'][0] ]); + $structure = $this->structureRepository->findOneBy(['indexName' => $metadata['type'][0]]); if ($structure !== null) { $document->setStructure($structure); } From 87816cab8e196d937ab6880155074a8264fb591f Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:20 +0200 Subject: [PATCH 078/111] Update Classes/Command/BaseCommand.php --- Classes/Command/BaseCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index 3de165604a..e9291e8f1f 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -301,7 +301,7 @@ protected function getParentDocumentUidForSaving(Document $document, bool $softC $parent = AbstractDocument::getInstance($doc->parentHref, ['storagePid' => $this->storagePid], true); if ($parent->recordId) { - $parentDocument = $this->documentRepository->findOneBy([ 'recordId' => $parent->recordId ]); + $parentDocument = $this->documentRepository->findOneBy(['recordId' => $parent->recordId]); if ($parentDocument === null) { // create new Document object From c12cc2dd8dbd3f19462a62cd4a584f7e822c0071 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:27 +0200 Subject: [PATCH 079/111] Update Classes/Command/BaseCommand.php --- Classes/Command/BaseCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index e9291e8f1f..3f3c886f7f 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -339,7 +339,7 @@ protected function getParentDocumentUidForSaving(Document $document, bool $softC private function addCollections(Document &$document, array $collections): void { foreach ($collections as $collection) { - $documentCollection = $this->collectionRepository->findOneBy([ 'indexName' => $collection ]); + $documentCollection = $this->collectionRepository->findOneBy(['indexName' => $collection]); if (!$documentCollection) { // create new Collection object $documentCollection = GeneralUtility::makeInstance(Collection::class); From e2c239ec485ec12f99b51abb0ca4290e5d33ac8e Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:34 +0200 Subject: [PATCH 080/111] Update Classes/Command/BaseCommand.php --- Classes/Command/BaseCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index 3f3c886f7f..0b033161b3 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -432,7 +432,7 @@ private function setOwner($owner): void if (empty($this->owner)) { // owner is not set set but found by metadata --> take it or take default library $owner = $owner ? : 'default'; - $this->owner = $this->libraryRepository->findOneBy([ 'indexName' => $owner ]); + $this->owner = $this->libraryRepository->findOneBy(['indexName' => $owner]); if (empty($this->owner)) { // create library $this->owner = GeneralUtility::makeInstance(Library::class); From 28104d44e681ca6a310b3d4595b7f99ccb866530 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:41 +0200 Subject: [PATCH 081/111] Update Classes/Command/DbDocsCommand.php --- Classes/Command/DbDocsCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/DbDocsCommand.php b/Classes/Command/DbDocsCommand.php index 2569f3fd9c..ef092d3a60 100644 --- a/Classes/Command/DbDocsCommand.php +++ b/Classes/Command/DbDocsCommand.php @@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $typo3Version = (new Typo3Version())->getMajorVersion(); if ($typo3Version != 13) { - throw new RuntimeException(("dbdocs command can only be run with Typo3 v13")); + throw new RuntimeException(("dbdocs command can only be run with TYPO3 v13")); } $tables = $this->generator->collectTables(); From 24b7f0ad7feccaa0255638d08cc1d5d9abc6105d Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:47 +0200 Subject: [PATCH 082/111] Update Classes/Domain/Repository/DocumentRepository.php --- Classes/Domain/Repository/DocumentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 50a326abd0..2f8cfdb578 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -82,7 +82,7 @@ public function findOneByParameters(array $parameters): ?Document $doc = AbstractDocument::getInstance($parameters['location']); if ($doc !== null && $doc->recordId) { - $document = $this->findOneBy([ 'recordId' => $doc->recordId ]); + $document = $this->findOneBy(['recordId' => $doc->recordId]); } if ($document === null) { From daca61a888e940250a3e521ca2740287add3e039 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:39:58 +0200 Subject: [PATCH 083/111] Update Classes/Domain/Repository/DocumentRepository.php --- Classes/Domain/Repository/DocumentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 2f8cfdb578..36c53433ff 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -685,7 +685,7 @@ private function findSolr( */ public function getPreviousDocumentUid(int $uid): ?int { - $currentDocument = $this->findOneBy([ 'uid' => $uid ]); + $currentDocument = $this->findOneBy(['uid' => $uid]); if ($currentDocument) { $parentId = $currentDocument->getPartof(); From 54e0d1d67817dc46dac308129c65913e721a693e Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:40:06 +0200 Subject: [PATCH 084/111] Update Classes/Domain/Repository/DocumentRepository.php --- Classes/Domain/Repository/DocumentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index 36c53433ff..a1fb5321de 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -735,7 +735,7 @@ public function getPreviousDocumentUid(int $uid): ?int */ public function getNextDocumentUid(int $uid): ?int { - $currentDocument = $this->findOneBy([ 'uid' => $uid ]); + $currentDocument = $this->findOneBy(['uid' => $uid]); if ($currentDocument) { $parentId = $currentDocument->getPartof(); From 2ae6e553fbf2e64f0bc4833aaafb78b3ff5bc1f8 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:40:12 +0200 Subject: [PATCH 085/111] Update Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php --- Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php index 80835de9dd..614752bb9d 100644 --- a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php +++ b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php @@ -175,7 +175,7 @@ protected function loadDocument(array $requestData, int $pid): void if ($doc !== null) { if ($doc->recordId) { - $this->document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); + $this->document = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); } if (!isset($this->document)) { // create new dummy Document object From 60afa1c26f69a7b14db54b316023b2d0467d1686 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:40:19 +0200 Subject: [PATCH 086/111] Update Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php --- Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php index 614752bb9d..6fbc3c57e4 100644 --- a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php +++ b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php @@ -190,7 +190,7 @@ protected function loadDocument(array $requestData, int $pid): void $this->document->setCurrentDocument($doc); } } elseif (!empty($requestData['recordId'])) { - $this->document = $this->documentRepository->findOneBy([ 'recordId' => $requestData['recordId'] ]); + $this->document = $this->documentRepository->findOneBy(['recordId' => $requestData['recordId']]); if ($this->document !== null) { $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid]); if ($doc !== null) { From acad802af4b62028843b1b9c539574d8666ff581 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:40:33 +0200 Subject: [PATCH 087/111] Update Classes/Command/DeleteCommand.php --- Classes/Command/DeleteCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/DeleteCommand.php b/Classes/Command/DeleteCommand.php index a8e052bbe4..0ca277e0db 100644 --- a/Classes/Command/DeleteCommand.php +++ b/Classes/Command/DeleteCommand.php @@ -220,7 +220,7 @@ private function getDocument($input): ?Document $doc = AbstractDocument::getInstance($input->getOption('doc'), ['storagePid' => $this->storagePid], true); if ($doc->recordId) { - $document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); + $document = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); } else { $document = $this->documentRepository->findOneBy([ 'location' => $input->getOption('doc') ]); } From 9eef26feb51da65dbf8faf8caa10a73328cc70c9 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:40:46 +0200 Subject: [PATCH 088/111] Update Classes/Command/DeleteCommand.php --- Classes/Command/DeleteCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/DeleteCommand.php b/Classes/Command/DeleteCommand.php index 0ca277e0db..eda5ba3805 100644 --- a/Classes/Command/DeleteCommand.php +++ b/Classes/Command/DeleteCommand.php @@ -222,7 +222,7 @@ private function getDocument($input): ?Document if ($doc->recordId) { $document = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); } else { - $document = $this->documentRepository->findOneBy([ 'location' => $input->getOption('doc') ]); + $document = $this->documentRepository->findOneBy(['location' => $input->getOption('doc')]); } } From 2a56a47d2a45570b006fee56998fdc3d23224344 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:40:59 +0200 Subject: [PATCH 089/111] Update Classes/Command/HarvestCommand.php --- Classes/Command/HarvestCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/HarvestCommand.php b/Classes/Command/HarvestCommand.php index dfb26df837..890fc252df 100644 --- a/Classes/Command/HarvestCommand.php +++ b/Classes/Command/HarvestCommand.php @@ -240,7 +240,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if ($doc->recordId) { - $document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); + $document = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); } if ($document === null) { From 655eaf1943148954b1541d6d6edf24c8a34a30fb Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:41:11 +0200 Subject: [PATCH 090/111] Update Classes/Command/IndexCommand.php --- Classes/Command/IndexCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index e98ff410ac..fa8b9e1dbc 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -150,7 +150,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (MathUtility::canBeInterpretedAsInteger($input->getOption('owner'))) { $this->owner = $this->libraryRepository->findByUid(MathUtility::forceIntegerInRange((int) $input->getOption('owner'), 1)); } else { - $this->owner = $this->libraryRepository->findOneBy([ 'indexName' => (string) $input->getOption('owner')]); + $this->owner = $this->libraryRepository->findOneBy(['indexName' => (string) $input->getOption('owner')]); } } else { $this->owner = null; From 2f0497591f18fa5b20f71972c925f3427e45ac67 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:41:22 +0200 Subject: [PATCH 091/111] Update Classes/Command/IndexCommand.php --- Classes/Command/IndexCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index fa8b9e1dbc..b188ef4f8d 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -232,7 +232,7 @@ private function getDocumentFromUrl($doc, string $url): Document $document = null; if ($doc->recordId ?? false) { - $document = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); + $document = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); } else { $document = $this->documentRepository->findOneBy([ 'location' => $url ]); } From 54f4c6bbc843e81290d48689efaef3e599dc18a1 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:41:34 +0200 Subject: [PATCH 092/111] Update Classes/Command/IndexCommand.php --- Classes/Command/IndexCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index b188ef4f8d..4e478dce08 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -234,7 +234,7 @@ private function getDocumentFromUrl($doc, string $url): Document if ($doc->recordId ?? false) { $document = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); } else { - $document = $this->documentRepository->findOneBy([ 'location' => $url ]); + $document = $this->documentRepository->findOneBy(['location' => $url]); } if ($document === null) { From fa88a212a11c47de42ae08c0417a36eb4d85e965 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:41:46 +0200 Subject: [PATCH 093/111] Update Classes/Command/ReindexCommand.php --- Classes/Command/ReindexCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Command/ReindexCommand.php b/Classes/Command/ReindexCommand.php index 1f72875cb6..da60ef120a 100644 --- a/Classes/Command/ReindexCommand.php +++ b/Classes/Command/ReindexCommand.php @@ -155,7 +155,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (MathUtility::canBeInterpretedAsInteger($input->getOption('owner'))) { $this->owner = $this->libraryRepository->findByUid(MathUtility::forceIntegerInRange((int) $input->getOption('owner'), 1)); } else { - $this->owner = $this->libraryRepository->findOneBy([ 'indexName' => (string) $input->getOption('owner') ]); + $this->owner = $this->libraryRepository->findOneBy(['indexName' => (string) $input->getOption('owner')]); } } else { $this->owner = null; From fce9e94a2f1f3a886754e852ecb9c2d5bfb99a45 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:41:58 +0200 Subject: [PATCH 094/111] Update Classes/Controller/AbstractController.php --- Classes/Controller/AbstractController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 291a995dd0..4e902e17e4 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -225,7 +225,7 @@ protected function loadDocument(string $documentId = ''): void } elseif (!empty($this->requestData['recordId'])) { - $this->document = $this->documentRepository->findOneBy([ 'recordId' => $this->requestData['recordId'] ]); + $this->document = $this->documentRepository->findOneBy(['recordId' => $this->requestData['recordId']]); if ($this->document !== null) { $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings); From e86abe4606386829b6f27af8dc3e20a60168705f Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:42:10 +0200 Subject: [PATCH 095/111] Update Classes/Controller/AbstractController.php --- Classes/Controller/AbstractController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 4e902e17e4..1cd79b9b2c 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -730,7 +730,7 @@ protected function getDocumentByUrl(string $documentUrl) if ($doc->recordId) { // find document from repository by recordId - $docFromRepository = $this->documentRepository->findOneBy([ 'recordId' => $doc->recordId ]); + $docFromRepository = $this->documentRepository->findOneBy(['recordId' => $doc->recordId]); if ($docFromRepository !== null) { $this->document = $docFromRepository; } From 961654c3def0f8469885e101beeaeb761925b4df Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:42:21 +0200 Subject: [PATCH 096/111] Update Classes/Controller/Backend/NewTenantController.php --- Classes/Controller/Backend/NewTenantController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index 3b76b56c99..d85c0af3dd 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -210,7 +210,7 @@ public function addFormatAction(): ResponseInterface foreach ($formatsDefaults as $type => $values) { // if default format record is not found, add it to the repository - if ($this->formatRepository->findOneBy([ 'type' => $type ]) === null) { + if ($this->formatRepository->findOneBy(['type' => $type]) === null) { $newRecord = GeneralUtility::makeInstance(Format::class); $newRecord->setType($type); $newRecord->setRoot($values['root']); From f936955f2ceb31e05d335a8d1cfd5cab93b3e0b5 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:42:32 +0200 Subject: [PATCH 097/111] Update Classes/Controller/Backend/NewTenantController.php --- Classes/Controller/Backend/NewTenantController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index d85c0af3dd..e170de6fb2 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -333,7 +333,7 @@ public function addSolrCoreAction(): ResponseInterface // load language file in own array $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language()); - if ($this->solrCoreRepository->findOneBy([ 'pid' => $this->pid ]) === null) { + if ($this->solrCoreRepository->findOneBy(['pid' => $this->pid]) === null) { $newRecord = GeneralUtility::makeInstance(SolrCore::class); $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')'); $indexName = Solr::createCore(''); From 1ed1ed5a1c69c7fdafd2d601e29526d226a397c8 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:42:42 +0200 Subject: [PATCH 098/111] Update Classes/Controller/Backend/NewTenantController.php --- Classes/Controller/Backend/NewTenantController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index e170de6fb2..77ab971985 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -434,7 +434,7 @@ public function indexAction(): ResponseInterface $recordInfos['formats']['numDefault'] = count($formatsDefaults); $structuresDefaults = $this->getRecords('Structure'); - $recordInfos['structures']['numCurrent'] = $this->structureRepository->count([ 'pid' => $this->pid ]); + $recordInfos['structures']['numCurrent'] = $this->structureRepository->count(['pid' => $this->pid]); $recordInfos['structures']['numDefault'] = count($structuresDefaults); $metadataDefaults = $this->getRecords('Metadata'); From c88fce812cdf900304a6401f0f23a4402ce7d38e Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:42:52 +0200 Subject: [PATCH 099/111] Update Classes/Controller/Backend/NewTenantController.php --- Classes/Controller/Backend/NewTenantController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index 77ab971985..0c044586ce 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -438,7 +438,7 @@ public function indexAction(): ResponseInterface $recordInfos['structures']['numDefault'] = count($structuresDefaults); $metadataDefaults = $this->getRecords('Metadata'); - $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->count([ 'pid' => $this->pid ]); + $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->count(['pid' => $this->pid]); $recordInfos['metadata']['numDefault'] = count($metadataDefaults); $recordInfos['solrcore']['numCurrent'] = $this->solrCoreRepository->count([ 'pid' => $this->pid ]); From 4a551501683da007eff49c8c4a95f4eb262b60a5 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:43:04 +0200 Subject: [PATCH 100/111] Update Classes/Controller/Backend/NewTenantController.php --- Classes/Controller/Backend/NewTenantController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/Backend/NewTenantController.php b/Classes/Controller/Backend/NewTenantController.php index 0c044586ce..fff5746e3f 100644 --- a/Classes/Controller/Backend/NewTenantController.php +++ b/Classes/Controller/Backend/NewTenantController.php @@ -441,7 +441,7 @@ public function indexAction(): ResponseInterface $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->count(['pid' => $this->pid]); $recordInfos['metadata']['numDefault'] = count($metadataDefaults); - $recordInfos['solrcore']['numCurrent'] = $this->solrCoreRepository->count([ 'pid' => $this->pid ]); + $recordInfos['solrcore']['numCurrent'] = $this->solrCoreRepository->count(['pid' => $this->pid]); $viewData = ['recordInfos' => $recordInfos]; From 81dec1cc450b207fb18325fc234da193943113c9 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:43:14 +0200 Subject: [PATCH 101/111] Update Classes/Controller/BasketController.php --- Classes/Controller/BasketController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index d8d3c7e4fd..dc25eda97c 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -247,7 +247,7 @@ protected function getBasketData(): Basket $userIsLoggedIn = $this->isUserLoggedIn(); if ($userIsLoggedIn) { - $basket = $this->basketRepository->findOneBy([ 'feUserId' => (int) $feUser->getUserId() ]); + $basket = $this->basketRepository->findOneBy(['feUserId' => (int) $feUser->getUserId()]); } else { $userSession->set('ses', 'tx_dlf_basket', ''); $userSession->dataWasUpdated(); From ef0cf48e0bbe14f6a86c955f3ad642cd05ddc423 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:43:24 +0200 Subject: [PATCH 102/111] Update Classes/Controller/BasketController.php --- Classes/Controller/BasketController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index dc25eda97c..278ceaaa1d 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -253,7 +253,7 @@ protected function getBasketData(): Basket $userSession->dataWasUpdated(); $feUser->storeSessionData(); - $basket = $this->basketRepository->findOneBy([ 'sessionId' => $userSession->getIdentifier() ]); + $basket = $this->basketRepository->findOneBy(['sessionId' => $userSession->getIdentifier()]); } // session does not exist From 280cf0ecaaf467236cae2d58f97fabfed9e39c07 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:43:34 +0200 Subject: [PATCH 103/111] Update Classes/Controller/BasketController.php --- Classes/Controller/BasketController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index 278ceaaa1d..54eaf4a963 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -641,7 +641,7 @@ protected function printDocument(): void $printerId = $this->requestData['print_action']; // get id from db and send selected doc download link - $printer = $this->printerRepository->findOneBy([ 'uid' => $printerId ]); + $printer = $this->printerRepository->findOneBy(['uid' => $printerId]); // printer is selected if ($printer) { From d3bde74b84a6f708ebb96124e6d4e2f1f85ae61e Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:43:44 +0200 Subject: [PATCH 104/111] Update Classes/Controller/CalendarController.php --- Classes/Controller/CalendarController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/CalendarController.php b/Classes/Controller/CalendarController.php index ddb03f9429..beaea18989 100644 --- a/Classes/Controller/CalendarController.php +++ b/Classes/Controller/CalendarController.php @@ -161,7 +161,7 @@ public function yearsAction(): ResponseInterface // Get all children of anchor. This should be the year anchor documents $documents = $this->documentRepository->getChildrenOfYearAnchor( $this->document->getUid(), - $this->structureRepository->findOneBy([ 'indexName' => 'year' ]) + $this->structureRepository->findOneBy(['indexName' => 'year']) ); $years = []; From 893238bc4acfcaf6e1831c2b822f57af62ad4a76 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:43:54 +0200 Subject: [PATCH 105/111] Update Classes/Controller/CalendarController.php --- Classes/Controller/CalendarController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/CalendarController.php b/Classes/Controller/CalendarController.php index beaea18989..eeb948de5d 100644 --- a/Classes/Controller/CalendarController.php +++ b/Classes/Controller/CalendarController.php @@ -457,7 +457,7 @@ private function getIssues(): Generator { $documents = $this->documentRepository->getChildrenOfYearAnchor( $this->document->getUid(), - $this->structureRepository->findOneBy([ 'indexName' => 'issue' ]) + $this->structureRepository->findOneBy(['indexName' => 'issue']) ); // Process results. From 7b773832f14ec6b01289a1c4a9a06037346ba7bc Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:44:02 +0200 Subject: [PATCH 106/111] Update Classes/Controller/MetadataController.php --- Classes/Controller/MetadataController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/MetadataController.php b/Classes/Controller/MetadataController.php index c8ecbbf0b7..bce24c7e46 100644 --- a/Classes/Controller/MetadataController.php +++ b/Classes/Controller/MetadataController.php @@ -447,7 +447,7 @@ private function parseOwner(int $i, array &$metadata) : void */ private function parseType(int $i, array &$metadata) : void { - $structure = $this->structureRepository->findOneBy([ 'indexName' => $metadata[$i]['type'][0] ]); + $structure = $this->structureRepository->findOneBy(['indexName' => $metadata[$i]['type'][0]]); if ($structure) { $metadata[$i]['type'][0] = $structure->getLabel(); } From 5ed0ee4913b4e092d346c99baf8960cfdb4d4ca4 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:44:14 +0200 Subject: [PATCH 107/111] Update Classes/Controller/MetadataController.php --- Classes/Controller/MetadataController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/MetadataController.php b/Classes/Controller/MetadataController.php index bce24c7e46..d75e0c8b99 100644 --- a/Classes/Controller/MetadataController.php +++ b/Classes/Controller/MetadataController.php @@ -468,7 +468,7 @@ private function parseCollections(int $i, $value, array &$metadata) : void { $j = 0; foreach ($value as $entry) { - $collection = $this->collectionRepository->findOneBy([ 'indexName' => $entry ]); + $collection = $this->collectionRepository->findOneBy(['indexName' => $entry]); if ($collection) { $metadata[$i]['collection'][$j] = $collection->getLabel() ? : ''; $j++; From 9abeca2a0185e0238e8e70447e52e38ff7dcfe6e Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:44:26 +0200 Subject: [PATCH 108/111] Update Classes/Controller/OaiPmhController.php --- Classes/Controller/OaiPmhController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index a159fcec09..33678989d2 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -201,7 +201,7 @@ private function getDublinCoreData(array $record) $record[] = ['dc:format' => $record['application/mets+xml'] ?? '']; $record[] = ['dc:type' => $record['Text'] ?? '']; if (!empty($record['partof'])) { - $document = $this->documentRepository->findOneBy([ 'partof' => $metadata['partof'] ?? '' ]); + $document = $this->documentRepository->findOneBy(['partof' => $metadata['partof'] ?? '']); if ($document) { $metadata[] = ['dc:relation' => $document->getRecordId()]; From a86a7f9c23f3cfac920161b2de9c8a9a16a5fbe5 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:44:37 +0200 Subject: [PATCH 109/111] Update Classes/Controller/OaiPmhController.php --- Classes/Controller/OaiPmhController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index 33678989d2..a0e8de1480 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -317,7 +317,7 @@ public function mainAction(): ResponseInterface */ protected function resume(): ?array { - $token = $this->tokenRepository->findOneBy([ 'token' => $this->parameters['resumptionToken'] ]); + $token = $this->tokenRepository->findOneBy(['token' => $this->parameters['resumptionToken']]); if ($token) { $options = $token->getOptions(); From 3ac96e148f06e07c108d40ef5746d6c1d902a541 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:44:47 +0200 Subject: [PATCH 110/111] Update Classes/Controller/OaiPmhController.php --- Classes/Controller/OaiPmhController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index a0e8de1480..c2ea2eacc9 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -492,7 +492,7 @@ protected function verbListMetadataFormats() $resArray = []; // check for the optional "identifier" parameter if (isset($this->parameters['identifier'])) { - $resArray = $this->documentRepository->findOneBy([ 'recordId' => $this->parameters['identifier'] ]); + $resArray = $this->documentRepository->findOneBy(['recordId' => $this->parameters['identifier']]); } $resultSet = []; From 55a2322289f69116e757ec8cdde86a7bd9cdb0be Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 1 Sep 2025 17:44:58 +0200 Subject: [PATCH 111/111] Update Classes/Domain/Repository/DocumentRepository.php --- Classes/Domain/Repository/DocumentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index a1fb5321de..cd6d9a80db 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -75,7 +75,7 @@ public function findOneByParameters(array $parameters): ?Document } else if (isset($parameters['recordId'])) { - $document = $this->findOneBy([ 'recordId' => $parameters['recordId'] ]); + $document = $this->findOneBy(['recordId' => $parameters['recordId']]); } else if (isset($parameters['location']) && GeneralUtility::isValidUrl($parameters['location'])) {