Deprecation: #86198 - Protected RecordListController
See forge#86198
Description
The following properties of class
\TYPO3\ changed their visibility from public
to protected and should not be called any longer:
idpointertablesearch_field search_levels showLimit returnUrl clear_cache cmdcmd_table perms_clause pageinfoMOD_MENU contentbodyimagemodedoc
The following methods of class
\TYPO3\ changed their visibility from public
to protected and should not be called any longer:
init() menuConfig () clearCache () main() getModule Template ()
Additionally, the two hooks
$GLOBALS['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['recordlist/ Modules/ Recordlist/ index. php'] ['draw Header Hook'] $GLOBALS['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['recordlist/ Modules/ Recordlist/ index. php'] ['draw Footer Hook']
changed their signature:
The second argument, an instance of the parent object
Record will be removed in TYPO3 v10. Use the instance of the PSR-7
Server that is provided as array key
request of the first argument.
Furthermore, the assignment of an object instance of class
Record as
GLOBALS has been marked as deprecated and will not be set anymore in TYPO3 v10.
Impact
Calling one of the above methods or accessing above properties will trigger a PHP
E_ error.
Affected Installations
Instances are usually only affected if an extension registers a hook for
$GLOBALS or
$GLOBALS. They will
work as before in TYPO3 v9, but using a property or calling a method of the provided parent object will trigger a PHP
E_ error.
Migration
Hooks registered should change their parent object usage and signature. An example can be found in the sys_ extension
in class
\TYPO3\.
Code before:
/**
* Add sys_notes as additional content to the header of the list module
*
* @param array $params
* @param RecordListController $parentObject
* @return string
*/
public function renderInHeader(array $params = [], RecordListController $parentObject)
{
$controller = GeneralUtility::makeInstance(NoteController::class);
return $controller->listAction($parentObject->id, SysNoteRepository::SYS_NOTE_POSITION_TOP);
}
Adapted hook usage:
/**
* Add sys_notes as additional content to the header of the list module
*
* @param array $params
* @return string
*/
public function renderInHeader(array $params): string
{
/** @var ServerRequestInterface $request */
$request = $params['request'];
$id = (int)($request->getParsedBody()['id'] ?? $request->getQueryParams()['id'] ?? 0);
$controller = GeneralUtility::makeInstance(NoteController::class);
return $controller->listAction($id, SysNoteRepository::SYS_NOTE_POSITION_TOP);
}