kitodo-presentation icon indicating copy to clipboard operation
kitodo-presentation copied to clipboard

Support for TYPO3 v10.x

Open sebastian-meyer opened this issue 5 years ago • 1 comments

The following changes are needed in order to reach full compatibility with TYPO3 v10 while keeping support for TYPO3 v9. Support for older TYPO3 version will be dropped.


  • [x] Remove deprecated TYPO3\CMS\Core\Core\Bootstrap::getInstance() and use TYPO3\CMS\Core\Core\Bootstrap::init() instead

    See changes on the typo3/testing-framework which formerly used early instance bootstrap calls for an example on how existing code can be refactored to use the top level Bootstrap::init() instead.

    • [x] Classes/Command/IndexCommand.php
    • [x] Classes/Command/ReindexCommand.php

  • [x] Remove deprecated calls to $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] and use new API instead

    Use a new API to retrieve extension configuration, examples: // Retrieve a single key $backendFavicon = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('backend', 'backendFavicon');

    // Retrieve whole configuration $backendConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('backend');

    // Fully qualified class names for usage in ext_localconf.php / ext_tables.php $backendConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->get('backend');

    • [x] class.ext_update.php
    • [x] Classes/Common/AbstractModule.php
    • [x] Classes/Common/AbstractPlugin.php
    • [x] Classes/Common/Document.php
    • [x] Classes/Common/IiifManifest.php
    • [x] Classes/Common/Indexer.php
    • [x] Classes/Common/MetsDocument.php
    • [x] Classes/Common/Solr.php
    • [x] Classes/Hooks/ConfigurationForm.php
    • [x] Classes/Hooks/DataHandler.php

  • [x] Remove deprecated TYPO3\CMS\Core\TypoScript\TemplateService->getFileName() and use TYPO3\CMS\Frontend\Resource\FilePathSanitizer->sanitize($filePath) instead

    Use TYPO3\CMS\Frontend\Resource\FilePathSanitizer->sanitize($filePath) instead.

    • [x] Classes/Common/AbstractPlugin.php
    • [x] Classes/Plugin/PageGrid.php

  • [x] Remove dependencies on deprecated TYPO3\CMS\Backend\Module\BaseScriptClass

    A migration is often relatively simple: Extensions that extend BaseScriptClass should verify which methods and properties are actually used from the parent class. The most simple solution is to just copy those over to the own class and remove the inheritance. It is good practice to at least change their visibility from public to protected at the same time if possible.

    • [x] Classes/Common/AbstractModule.php

  • [x] Remove dependencies on devLog and use new Logging API instead

    The PHP method TYPO3\CMS\Core\Utility\GeneralUtility::devLog() has been deprecated in favour of the Logging API. Additionally these PHP symbols have been deprecated as well:

    • TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_* constants
    • TYPO3\CMS\Core\Service\AbstractService::devLog()
    • $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['devLog']
    • [x] Classes/Common/Helper.php

  • [x] Remove deprecated TSFE-related language functions and use LanguageService API instead

    Use TypoScriptFrontendController->sL() for resolving language labels in the language of the Frontend rendering engine as a replacement for getLLL().

    If you are not doing anything special on language initialization, the call to initLLvars() can likely be dropped. If you need to influence language initialization yourself, you can use the hooks $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_preProcess'] or $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess'].

    For doing special logic, it is recommend to set up a custom instance of LanguageService which holds all functionality directly.

    For example you may then use $languageService->includeLLFile(...); instead of readLLfile().

    • [x] Classes/Common/Helper.php (readLLfile() and getLLL())

  • [x] Remove deprecated TSFE-related language properties and use LanguageAspect instead

    Use the new LanguageAspect with various superior properties to access the various values.

    $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language'); // (previously known as TSFE->sys_language_uid) $languageAspect->getId(); // (previously known as TSFE->sys_language_content) $languageAspect->getContentId(); // (previously known as TSFE->sys_language_contentOL) $languageAspect->getLegacyOverlayType(); // (previously known as TSFE->sys_language_mode) $languageAspect->getLegacyLanguageMode();

    Also, have a detailed look on what other properties the language aspect offers for creating fallback chains, and more sophisticated overlays.

    • [x] Classes/Common/Helper.php ($GLOBALS['TSFE']->sys_language_content and $GLOBALS['TSFE']->sys_language_contentOL)
    • [x] Classes/Plugin/Collection.php ($GLOBALS['TSFE']->sys_language_uid, $GLOBALS['TSFE']->sys_language_content and $GLOBALS['TSFE']->sys_language_contentOL)
    • [x] Classes/Plugin/Metadata.php ($GLOBALS['TSFE']->sys_language_uid, $GLOBALS['TSFE']->sys_language_content and $GLOBALS['TSFE']->sys_language_contentOL)

  • [ ] Remove deprecated call to TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->storeSessionData() and use PSR-15 middleware instead

    As all functionality has been set up via PSR-15 middlewares, use a PSR-15 middleware instead.

    • [x] Classes/Common/Helper.php
    • [ ] Classes/Plugin/Basket.php

  • [x] Make sure method enableFields() is only called from PageRepository class instead of old ContentObjectRenderer class

    As enableFields() acts as a simple wrapper around PageRepository->enableFields(), it is recommended to instantiate PageRepository directly.

    • [x] Classes/Common/Helper.php

  • [ ] Remove deprecated $GLOBALS['TSFE']->loginUser and use new Context API instead

    Use Context API / Aspects instead to read from this information:

    $context = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class); $context->getPropertyFromAspect('visibility', 'includeHiddenPages') instead of $TSFE->showHiddenPage $context->getPropertyFromAspect('visibility', 'includeHiddenContent') instead of $TSFE->showHiddenRecords $context->getPropertyFromAspect('frontend.user', 'isLoggedIn') instead of $TSFE->loginUser $context->getPropertyFromAspect('backend.user', 'isLoggedIn') instead of $TSFE->beUserLogin $context->getPropertyFromAspect('frontend.user', 'groupIds') instead of $TSFE->gr_list

    For more information see Context API chapter in TYPO3 Explained.

    • [ ] Classes/Plugin/Basket.php

  • [x] Use \TYPO3\CMS\Core\Core\Environment::isCli() instead of TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI
    • [x] Classes/Common/Document.php
    • [x] Classes/Common/Indexer.php

  • [x] Change command registration to Configuration/Services.yaml instead of Configuration/Commands.php

    See https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Feature-89139-AddDependencyInjectionSupportForConsoleCommands.html

    • [x] Configuration/Commands.php --> This feature is for TYPO3 10 and up. So it can only be part of Kitodo.Presentation 5.0.

  • [x] Convert language files to XLIFF format

    This can be done easily with extensions like ew_llxml2xliff --> Reduce the amount of language files and labels. --> Support English (default) and German (translation)


  • [x] Replace GeneralUtility::getUrl() by PSR-7 pattern

    See https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.4/Deprecation-90956-AlternativeFetchMethodsAndReportsForGeneralUtilitygetUrl.html PSR-7 compatible way works since TYPO3 8, so this can be replaced safely.

sebastian-meyer avatar May 07 '20 10:05 sebastian-meyer

@chrizzor Since Kitodo.Presentation 4.0 we fully support TYPO3 v10. But there are two possible issues with the basket feature which we can't test (see above). As the original developer of this plugin could you please verify that the basket feature works with TYPO3 v10?

sebastian-meyer avatar Sep 14 '22 07:09 sebastian-meyer

@chrizzor There are still two issues which could break TYPO3v10 compatibility in the Basket plugin. Could you please provide a patch for this file?

sebastian-meyer avatar Feb 06 '23 09:02 sebastian-meyer

@sebastian-meyer With #903 the new context api is used instead of loginUser. Everything else seems to work as expected. Tested with Typo3 10.4.32

chrizzor avatar Feb 07 '23 12:02 chrizzor

Thank you!

sebastian-meyer avatar Feb 07 '23 13:02 sebastian-meyer