Commit 7df7dee3 authored by Benni Mack's avatar Benni Mack Committed by Christian Kuhn
Browse files

[!!!][TASK] Remove tce_db options "prErr" and "uPT"

The two GET/POST parameters "prErr" (Print Errors) and "uPT" (Update Pagetree)
are removed.

The GET/POST parameter "uPT" is there to explicitly request a refresh of
the page tree if visible on the next module load.

The GET/POST parameter "prErr" adds flash messages to the session queue
which should be a default behaviour anyway.

Please note that this only affects the SimpleDataHandlerController (BE module "tce_db") and no datahandler calls itself.

The first parameter of DataHandler->printLogErrorMessages() is removed
as it is unused.

Resolves: #82629
Releases: master
Change-Id: Ifc925e49b49f1537a65141810403a7758e0b448b
Reviewed-on: https://review.typo3.org/54244

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent f18d5742
......@@ -612,8 +612,6 @@ class Clipboard
public function pasteUrl($table, $uid, $setRedirect = true, array $update = null)
{
$urlParameters = [
'prErr' => 1,
'uPT' => 1,
'CB[paste]' => $table . '|' . $uid,
'CB[pad]' => $this->current
];
......@@ -636,8 +634,6 @@ class Clipboard
public function deleteUrl($setRedirect = 1, $file = 0)
{
$urlParameters = [
'prErr' => 1,
'uPT' => 1,
'CB[delete]' => 1,
'CB[pad]' => $this->current
];
......
......@@ -684,7 +684,7 @@ class EditDocumentController extends AbstractModule
$this->previewData['table'] = $table;
$this->previewData['id'] = $id;
}
$tce->printLogErrorMessages(isset($_POST['_saveandclosedok']) || isset($_POST['_translation_savedok']) ? $this->retUrl : $this->R_URL_parts['path'] . '?' . GeneralUtility::implodeArrayForUrl('', $this->R_URL_getvars));
$tce->printLogErrorMessages();
}
// || count($tce->substNEWwithIDs)... If any new items has been save, the document is CLOSED
// because if not, we just get that element re-listed as new. And we don't want that!
......@@ -758,7 +758,7 @@ class EditDocumentController extends AbstractModule
}
}
function deleteRecord(table,id,url) { //
window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&prErr=1&uPT=1";
window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url);
}
';
......
......@@ -716,7 +716,7 @@ class PageLayoutController
' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '
function deleteRecord(table,id,url) { //
window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')
. ' + table + "][" + id + "][delete]=1&redirect=" + encodeURIComponent(url) + "&prErr=1&uPT=1";
. ' + table + "][" + id + "][delete]=1&redirect=" + encodeURIComponent(url);
return false;
}
');
......
......@@ -77,13 +77,6 @@ class SimpleDataHandlerController
*/
public $redirect;
/**
* Boolean. If set, errors will be printed on screen instead of redirection. Should always be used, otherwise you will see no errors if they happen.
*
* @var int
*/
public $prErr;
/**
* Clipboard command array. May trigger changes in "cmd"
*
......@@ -91,13 +84,6 @@ class SimpleDataHandlerController
*/
public $CB;
/**
* Boolean. Update Page Tree Trigger. If set and the manipulated records are pages then the update page tree signal will be set.
*
* @var int
*/
public $uPT;
/**
* TYPO3 Core Engine
*
......@@ -127,9 +113,7 @@ class SimpleDataHandlerController
$this->mirror = GeneralUtility::_GP('mirror');
$this->cacheCmd = GeneralUtility::_GP('cacheCmd');
$this->redirect = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('redirect'));
$this->prErr = GeneralUtility::_GP('prErr');
$this->CB = GeneralUtility::_GP('CB');
$this->uPT = GeneralUtility::_GP('uPT');
// Creating DataHandler object
$this->tce = GeneralUtility::makeInstance(DataHandler::class);
// Configuring based on user prefs.
......@@ -203,7 +187,7 @@ class SimpleDataHandlerController
$this->tce->clear_cacheCmd($this->cacheCmd);
}
// Update page tree?
if ($this->uPT && (isset($this->data['pages']) || isset($this->cmd['pages']))) {
if (isset($this->data['pages']) || isset($this->cmd['pages'])) {
BackendUtility::setUpdateSignal('updatePageTree');
}
}
......@@ -223,9 +207,7 @@ class SimpleDataHandlerController
$this->main();
// Write errors to flash message queue
if ($this->prErr) {
$this->tce->printLogErrorMessages($this->redirect);
}
$this->tce->printLogErrorMessages();
if ($this->redirect) {
$response = $response
->withHeader('Location', GeneralUtility::locationHeaderUrl($this->redirect))
......@@ -257,10 +239,7 @@ class SimpleDataHandlerController
];
// Prints errors (= write them to the message queue)
if ($this->prErr) {
$content['hasErrors'] = true;
$this->tce->printLogErrorMessages($this->redirect);
}
$this->tce->printLogErrorMessages();
$messages = $flashMessageService->getMessageQueueByIdentifier()->getAllMessagesAndFlush();
if (!empty($messages)) {
......
......@@ -41,7 +41,7 @@ class PageMovingPagePositionMap extends PagePositionMap
*/
public function onClickEvent($pid, $newPagePID)
{
return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tce_db') . '&cmd[pages][' . $GLOBALS['SOBE']->moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&redirect=' . rawurlencode($this->R_URI) . '&prErr=1&uPT=1') . ';return false;';
return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tce_db') . '&cmd[pages][' . $GLOBALS['SOBE']->moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&redirect=' . rawurlencode($this->R_URI)) . ';return false;';
}
/**
......
......@@ -562,9 +562,9 @@ class PagePositionMap
{
$table = 'tt_content';
if (is_array($row)) {
$location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=-' . $row['uid'] . '&prErr=1&uPT=1';
$location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=-' . $row['uid'];
} else {
$location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&data[' . $table . '][' . $moveUid . '][colPos]=' . $vv . '&prErr=1';
$location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&data[' . $table . '][' . $moveUid . '][colPos]=' . $vv;
}
$location .= '&redirect=' . rawurlencode($this->R_URI);
// returns to prev. page
......
......@@ -2639,11 +2639,7 @@ class BackendUtility
*/
public static function getLinkToDataHandlerAction($parameters, $redirectUrl = '')
{
$urlParameters = [
'prErr' => 1,
'uPT' => 1,
];
$url = self::getModuleUrl('tce_db', $urlParameters) . $parameters . '&redirect=';
$url = self::getModuleUrl('tce_db') . $parameters . '&redirect=';
if ((int)$redirectUrl === -1) {
$url = GeneralUtility::quoteJSvalue($url) . '+T3_THIS_LOCATION';
} else {
......
......@@ -111,14 +111,14 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
ContextMenuActions.disableRecord = function (table, uid) {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=1&prErr=1&redirect=' + ContextMenuActions.getReturnUrl()
top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=1&redirect=' + ContextMenuActions.getReturnUrl()
);
top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500);
};
ContextMenuActions.enableRecord = function (table, uid) {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=0&prErr=1&redirect=' + ContextMenuActions.getReturnUrl()
top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=0&redirect=' + ContextMenuActions.getReturnUrl()
);
top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500);
};
......@@ -145,7 +145,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
$modal.on('button.clicked', function (e) {
if (e.target.name === 'delete') {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.RecordCommit.moduleUrl + '&redirect=' + ContextMenuActions.getReturnUrl() + '&cmd[' + table + '][' + uid + '][delete]=1&prErr=1'
top.TYPO3.settings.RecordCommit.moduleUrl + '&redirect=' + ContextMenuActions.getReturnUrl() + '&cmd[' + table + '][' + uid + '][delete]=1'
);
if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) {
top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500);
......@@ -212,7 +212,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
var title = $anchorElement.data('title');
var performPaste = function () {
var url = '&CB[paste]=' + table + '%7C' + uid
+ '&CB[pad]=normal&prErr=1&uPT=1'
+ '&CB[pad]=normal'
+ '&redirect=' + ContextMenuActions.getReturnUrl();
top.TYPO3.Backend.ContentContainer.setUrl(
......@@ -253,4 +253,4 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
};
return ContextMenuActions;
});
\ No newline at end of file
});
......@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
......@@ -51,11 +50,7 @@ class IssueCommandViewHelper extends AbstractViewHelper
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
/** @var BackendUserAuthentication $beUser */
$beUser = $GLOBALS['BE_USER'];
$urlParameters = [
'prErr' => 1,
'uPT' => 1,
'redirect' => $arguments['redirectUrl'] ?: GeneralUtility::getIndpEnv('REQUEST_URI')
];
if (isset($arguments['parameters'])) {
......
......@@ -73,8 +73,6 @@ class RemoveUserViewHelper extends AbstractViewHelper
$urlParameters = [
'cmd[be_users][' . $backendUser->getUid() . '][delete]' => 1,
'prErr' => 1,
'uPT' => 1,
'redirect' => GeneralUtility::getIndpEnv('REQUEST_URI')
];
$url = BackendUtility::getModuleUrl('tce_db', $urlParameters);
......
......@@ -8753,10 +8753,8 @@ class DataHandler
/**
* Print log error messages from the operations of this script instance
*
* @param string $redirect Redirect URL (for creating link in message)
*/
public function printLogErrorMessages($redirect)
public function printLogErrorMessages()
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_log');
$queryBuilder->getRestrictions()->removeAll();
......
.. include:: ../../Includes.txt
===========================================================
Breaking: #82629 - Removed tce_db options "prErr" and "uPT"
===========================================================
See :issue:`82629`
Description
===========
The two options `prErr` ("print errors") and `uPT` ("update page tree"), usually set via GET/POST
when calling TYPO3's Backend endpoint `tce_db` (DataHandler actions within the TYPO3 Backend),
have been removed, and are now automatically evaluated when the endpoint is called.
The option `prErr` added possible errors to the Message Queue. The option `uPT` triggered an update
of the pagetree after a page-related action was made.
Both options are dropped as the functionality is enabled by default.
The corresponding methods have been adjusted:
* `TYPO3\CMS\Core\DataHandling\DataHandler->printLogErrorMessages()` does not need a method argument anymore.
* The public property `TYPO3\CMS\Backend\Controller\SimpleDataHandlerController->prErr` is removed
* The public property `TYPO3\CMS\Backend\Controller\SimpleDataHandlerController->uPT` is removed
Impact
======
Calling `tce_db` with any of the two options has no effect anymore.
Affected Installations
======================
Installations with third-party extensions accessing the entrypoint `tce_db` or calling
`DataHandler->printLogErrorMessages()` via PHP.
Migration
=========
Remove any of the parameters in the PHP code and everything will continue to work as before.
.. index:: Backend, PHP-API, FullyScanned
\ No newline at end of file
......@@ -145,7 +145,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
var title = $anchorElement.data('title');
var performPaste = function () {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.FileCommit.moduleUrl + '&prErr=1&uPT=1&CB[paste]=FILE|' + top.rawurlencode(uid) + '&CB[pad]=normal&redirect=' + ContextMenuActions.getReturnUrl()
top.TYPO3.settings.FileCommit.moduleUrl + '&CB[paste]=FILE|' + top.rawurlencode(uid) + '&CB[pad]=normal&redirect=' + ContextMenuActions.getReturnUrl()
);
};
if (!$anchorElement.data('title')) {
......@@ -186,7 +186,6 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
+ '&file['+ mode + '][0][data]=' + top.rawurlencode(uid)
+ '&file['+ mode + '][0][target]=' + top.rawurlencode(target)
+ '&redirect=' + ContextMenuActions.getReturnUrl()
+ '&prErr=1'
);
};
ContextMenuActions.dropMoveInto = function (table, uid) {
......
......@@ -117,4 +117,10 @@ return [
'Breaking-82572-RDCTFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Core\DataHandling\DataHandler->printLogErrorMessages' => [
'maximumNumberOfArguments' => 0,
'restFiles' => [
'Breaking-82629-TceDbOptionsPrErrAndUPTRemoved.rst',
],
],
];
......@@ -194,6 +194,15 @@ return [
'Breaking-82572-RDCTFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Backend\Controller\SimpleDataHandlerController->prErr' => [
'restFiles' => [
'Breaking-82629-TceDbOptionsPrErrAndUPTRemoved.rst',
],
],
'TYPO3\CMS\Backend\Controller\SimpleDataHandlerController->uPT' => [
'restFiles' => [
'Breaking-82629-TceDbOptionsPrErrAndUPTRemoved.rst',
],
],
// Deprecated public properties
];
......@@ -380,7 +380,7 @@ class RecordList extends AbstractModule
if (isset($cmd['pages'])) {
BackendUtility::setUpdateSignal('updatePageTree');
}
$tce->printLogErrorMessages(GeneralUtility::getIndpEnv('REQUEST_URI'));
$tce->printLogErrorMessages();
}
}
// Initialize the listing object, dblist, for rendering the list:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment