Support for TYPO3 v10.x
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 useTYPO3\CMS\Core\Core\Bootstrap::init()insteadSee 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]
- [x] Remove deprecated calls to
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']and use new API insteadUse 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]
- [x] Remove deprecated
TYPO3\CMS\Core\TypoScript\TemplateService->getFileName()and useTYPO3\CMS\Frontend\Resource\FilePathSanitizer->sanitize($filePath)insteadUse
TYPO3\CMS\Frontend\Resource\FilePathSanitizer->sanitize($filePath)instead.- [x]
Classes/Common/AbstractPlugin.php - [x]
Classes/Plugin/PageGrid.php
- [x]
- [x] Remove dependencies on deprecated
TYPO3\CMS\Backend\Module\BaseScriptClassA migration is often relatively simple: Extensions that extend
BaseScriptClassshould 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 frompublictoprotectedat the same time if possible.- [x]
Classes/Common/AbstractModule.php
- [x]
- [x] Remove dependencies on
devLogand use new Logging API insteadThe 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 forgetLLL().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
LanguageServicewhich holds all functionality directly.For example you may then use
$languageService->includeLLFile(...);instead ofreadLLfile().- [x]
Classes/Common/Helper.php(readLLfile()andgetLLL())
- [x]
- [x] Remove deprecated TSFE-related language properties and use LanguageAspect instead
Use the new
LanguageAspectwith 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_contentand$GLOBALS['TSFE']->sys_language_contentOL) - [x]
Classes/Plugin/Collection.php($GLOBALS['TSFE']->sys_language_uid,$GLOBALS['TSFE']->sys_language_contentand$GLOBALS['TSFE']->sys_language_contentOL) - [x]
Classes/Plugin/Metadata.php($GLOBALS['TSFE']->sys_language_uid,$GLOBALS['TSFE']->sys_language_contentand$GLOBALS['TSFE']->sys_language_contentOL)
- [x]
- [ ] Remove deprecated call to
TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->storeSessionData()and use PSR-15 middleware insteadAs 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]
- [x] Make sure method
enableFields()is only called fromPageRepositoryclass instead of oldContentObjectRendererclassAs
enableFields()acts as a simple wrapper aroundPageRepository->enableFields(), it is recommended to instantiate PageRepository directly.- [x]
Classes/Common/Helper.php
- [x]
- [ ] Remove deprecated
$GLOBALS['TSFE']->loginUserand use new Context API insteadUse 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_listFor more information see
Context API chapterin TYPO3 Explained.- [ ]
Classes/Plugin/Basket.php
- [ ]
- [x] Use
\TYPO3\CMS\Core\Core\Environment::isCli()instead ofTYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI- [x]
Classes/Common/Document.php - [x]
Classes/Common/Indexer.php
- [x]
- [x] Change command registration to
Configuration/Services.yamlinstead ofConfiguration/Commands.phpSee 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]
- [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.
@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?
@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 With #903 the new context api is used instead of loginUser. Everything else seems to work as expected. Tested with Typo3 10.4.32
Thank you!