Deprecation: #88787 - BackendUtility::editOnClick
See forge#88787
Description
The method \TYPO3\
used to generate JavaScript onclick
targets to
\TYPO3\
has been marked as deprecated.
Impact
Using this method will trigger PHP E_
error.
Affected Installations
All installations with extensions using \TYPO3\
are affected.
Migration
Migrate the method to use the \TYPO3\
API and attach the parameters manually.
Example:
// Previous
$old = BackendUtility::editOnClick($params);
// Migrated
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
// Variant 1
$params = '&edit[pages][' . $pid . ']=new&returnNewPageId=1';
$migrated = $uriBuilder->buildUriFromRoute('record_edit') . $params
. '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'));
// Variant 2
$params = [
'edit' => [
'pages' => [
$pid => 'new',
],
],
'returnNewPageId' => 1,
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
];
$migrated = (string)$uriBuilder->buildUriFromRoute('record_edit', params);
Copied!