diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-81318-PublicPropertiesOfPageRepository.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-81318-PublicPropertiesOfPageRepository.rst new file mode 100644 index 0000000000000000000000000000000000000000..c911a13dfacd47f559729b65980748f1f0a5ae5b --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-81318-PublicPropertiesOfPageRepository.rst @@ -0,0 +1,39 @@ +.. include:: ../../Includes.txt + +========================================================= +Deprecation: #81318 - Public properties of PageRepository +========================================================= + +See :issue:`81318` + +Description +=========== + +The following properties within the PageRepository PHP class have been marked as deprecated, as they +were moved from public access to protected access: + +* workspaceCache +* error_getRootLine +* error_getRootLine_failPid + +They should only be accessed from within the PHP class itself. + + +Impact +====== + +Accessing any of the properties directly within PHP will trigger a deprecation warning. + + +Affected Installations +====================== + +Extensions accessing one of the previously public properties directly. + + +Migration +========= + +Remove the PHP calls and either extend the PHP class to your own needs or avoid accessing these properties. + +.. index:: PHP-API, FullyScanned \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Page/PageRepository.php b/typo3/sysext/frontend/Classes/Page/PageRepository.php index 269de786bfdad6416d03c4e31a8ec0bcf7b66c90..56a8cb117c4355b02e78a6f696fc39ea4cd29065 100644 --- a/typo3/sysext/frontend/Classes/Page/PageRepository.php +++ b/typo3/sysext/frontend/Classes/Page/PageRepository.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\Frontend\Page; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; +use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryHelper; @@ -41,6 +42,17 @@ use TYPO3\CMS\Core\Versioning\VersionState; class PageRepository implements LoggerAwareInterface { use LoggerAwareTrait; + use PublicPropertyDeprecationTrait; + + /** + * List of all deprecated public properties + * @var array + */ + protected $deprecatedPublicProperties = [ + 'workspaceCache' => 'Using $workspaceCache from the outside is discouraged, as this only reflects a local runtime cache.', + 'error_getRootLine' => 'Using $error_getRootLine from the outside is deprecated as this property only exists for legacy reasons.', + 'error_getRootLine_failPid' => 'Using $error_getRootLine_failPid from the outside is deprecated as this property only exists for legacy reasons.', + ]; /** * This is not the final clauses. There will normally be conditions for the @@ -82,21 +94,21 @@ class PageRepository implements LoggerAwareInterface /** * @var array */ - public $workspaceCache = []; + protected $workspaceCache = []; /** * Error string set by getRootLine() * * @var string */ - public $error_getRootLine = ''; + protected $error_getRootLine = ''; /** * Error uid set by getRootLine() * * @var int */ - public $error_getRootLine_failPid = 0; + protected $error_getRootLine_failPid = 0; /** * @var array diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php index 7081430685c95f8cb1765a24799b7c1980d3262f..39099230fb56568da899cfbd7927a5414e87865d 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php @@ -221,4 +221,19 @@ return [ ], // Deprecated public properties + 'TYPO3\CMS\Frontend\Page\PageRepository->workspaceCache' => [ + 'restFiles' => [ + 'Deprecation-81318-PublicPropertiesOfPageRepository.rst', + ], + ], + 'TYPO3\CMS\Frontend\Page\PageRepository->error_getRootLine' => [ + 'restFiles' => [ + 'Deprecation-81318-PublicPropertiesOfPageRepository.rst', + ], + ], + 'TYPO3\CMS\Frontend\Page\PageRepository->error_getRootLine_failPid' => [ + 'restFiles' => [ + 'Deprecation-81318-PublicPropertiesOfPageRepository.rst', + ], + ], ];