From 9a71c6b210c47d8836117ed7c5cfc0ff2c68c2ba Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Mon, 7 Jan 2019 22:00:28 +0100 Subject: [PATCH 1/1] [!!!][TASK] Remove deprecated code from DocumentTemplate Resolves: #87361 Releases: master Change-Id: I21ff5db9c8f2faf303e93a0c897aa44f20f663b4 Reviewed-on: https://review.typo3.org/59369 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Wouter Wolters Tested-by: Wouter Wolters --- .../Classes/Template/DocumentTemplate.php | 61 ------------------- ...g-87193-DeprecatedFunctionalityRemoved.rst | 4 ++ .../Php/MethodCallMatcher.php | 2 + .../Php/PropertyProtectedMatcher.php | 3 +- 4 files changed, 8 insertions(+), 62 deletions(-) diff --git a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php index fcad5624d81f..6c389b33b9fd 100644 --- a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php +++ b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php @@ -20,7 +20,6 @@ use TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; -use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; @@ -47,14 +46,6 @@ use TYPO3\CMS\Core\Utility\PathUtility; class DocumentTemplate implements LoggerAwareInterface { use LoggerAwareTrait; - use PublicPropertyDeprecationTrait; - - /** - * @var array - */ - protected $deprecatedPublicProperties = [ - 'hasDocheader' => 'Using $hasDocheader of class DocumentTemplate is discouraged. The property is not evaluated in the TYPO3 core anymore and will be removed in TYPO3 v10.0.' - ]; // Vars you typically might want to/should set from outside after making instance of this class: /** @@ -219,12 +210,6 @@ function jumpToUrl(URL) { */ public $endOfPageJsBlock = ''; - /** - * @var bool - * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0 - */ - protected $hasDocheader = true; - /** * @var PageRenderer */ @@ -400,23 +385,6 @@ function jumpToUrl(URL) { return HttpUtility::buildQueryString($storeArray, '&'); } - /** - * Returns attributes to set the width of an text-type input field. - * For client browsers with no CSS support the cols/size attribute is returned. - * For CSS compliant browsers (recommended) a ' style="width: ...px;"' is returned. - * - * @param int $size A relative number which multiplied with approx. 10 will lead to the width in pixels - * @param bool $textarea A flag you can set for textareas - DEPRECATED as there is no difference any more between the two - * @param string $styleOverride A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled) - * @return string Tag attributes for an tag (regarding width) - * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. - */ - public function formWidth($size = 48, $textarea = false, $styleOverride = '') - { - trigger_error('DocumentTemplate->formWidth() will be removed in TYPO3 10.0 - use responsive code or direct inline styles to format your input fields instead.', E_USER_DEPRECATED); - return ' style="' . ($styleOverride ?: 'width:' . ceil($size * 9.58) . 'px;') . '"'; - } - /** * Returns JavaScript variables setting the returnUrl and thisScript location for use by JavaScript on the page. * Used in fx. db_list.php (Web>List) @@ -624,22 +592,6 @@ function jumpToUrl(URL) { } } - /** - * Insert additional style sheet link - * - * @param string $key some key identifying the style sheet - * @param string $href uri to the style sheet file - * @param string $title value for the title attribute of the link element - * @param string $relation value for the rel attribute of the link element - * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0 - * @see PageRenderer::addCssFile() - */ - public function addStyleSheet($key, $href, $title = '', $relation = 'stylesheet') - { - trigger_error('DocumentTemplate->->addStyleSheet() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED); - $this->pageRenderer->addCssFile($href, $relation, 'screen', $title); - } - /** * Add all *.css files of the directory $path to the stylesheets * @@ -722,19 +674,6 @@ function jumpToUrl(URL) { return 'TYPO3 CMS, ' . TYPO3_URL_GENERAL . ', © Kasper Skårhøj ' . TYPO3_copyright_year . ', extensions are copyright of their respective owners.'; } - /** - * Returns X-UA-Compatible meta tag - * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. - * - * @param string $content Content of the compatible tag (default: IE-8) - * @return string - */ - public function xUaCompatible($content = 'IE=8') - { - trigger_error('DocumentTemplate->xUaCompatible() will be removed with TYPO3 v10.0. Use PageRenderer->setMetaTag() instead.', E_USER_DEPRECATED); - return ''; - } - /***************************************** * * OTHER ELEMENTS diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst index 51a72ce626c1..1588cfc2e2a5 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst @@ -217,6 +217,9 @@ The following PHP class methods that have been previously deprecated for v9 have * :php:`TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extPageReadAccess()` * :php:`TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extGetTreeList()` * :php:`TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extGetLL()` +* :php:`TYPO3\CMS\Backend\Template\DocumentTemplate->addStyleSheet()` +* :php:`TYPO3\CMS\Backend\Template\DocumentTemplate->formWidth()` +* :php:`TYPO3\CMS\Backend\Template\DocumentTemplate->xUaCompatible()` * :php:`TYPO3\CMS\Core\Authentication\AbstractAuthenticationService->compareUident()` * :php:`TYPO3\CMS\Core\Authentication\AbstractUserAuthentication->compareUident()` * :php:`TYPO3\CMS\Core\Authentication\AbstractUserAuthentication->fetchUserRecord()` @@ -470,6 +473,7 @@ The following public class properties have been dropped: * :php:`TYPO3\CMS\Backend\FrontendBackendUserAuthentication->adminPanel` * :php:`TYPO3\CMS\Backend\FrontendBackendUserAuthentication->frontendEdit` * :php:`TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdminConfig` +* :php:`TYPO3\CMS\Backend\Template\DocumentTemplate->hasDocheader` * :php:`TYPO3\CMS\Core\Authentication\BackendUserAuthentication->userTS_dontGetCached` * :php:`TYPO3\CMS\Core\Charset\CharsetConverter->synonyms` * :php:`TYPO3\CMS\Core\DataHandling\DataHandler->updateModeL10NdiffData` diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php index 5e6b8a377d75..0c0a39a855f7 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php @@ -1309,6 +1309,7 @@ return [ 'maximumNumberOfArguments' => 3, 'restFiles' => [ 'Deprecation-81540-DeprecateDocumentTemplateformWidth.rst', + 'Breaking-87193-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility->sendSqlDumpFileToBrowserAndDelete' => [ @@ -2902,6 +2903,7 @@ return [ 'maximumNumberOfArguments' => 4, 'restFiles' => [ 'Deprecation-85735-MethodAndPropertyInDocumentTemplate.rst', + 'Breaking-87193-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Frontend\Page\PageRepository->getFileReferences' => [ diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php index dc7b258eb79c..2944bab7219d 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php @@ -707,7 +707,8 @@ return [ ], 'TYPO3\CMS\Backend\Template\DocumentTemplate->hasDocheader' => [ 'restFiles' => [ - 'Deprecation-85735-MethodAndPropertyInDocumentTemplate.rst' + 'Deprecation-85735-MethodAndPropertyInDocumentTemplate.rst', + 'Breaking-87193-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\Controller\PageLayoutController->popView' => [ -- 2.20.1