Actions
Bug #82282
closedError Message for "Disable" Action in the Pagetree Context Menu is Not Shown
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2017-09-04
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Steps to reproduce:
- Create a DataHandler hook (i.e. processDatamap_afterDatabaseOperations)ra
- Capture the disabling of the page.
- Log this as an error either by using one of the logging functions of the DataHandler class or directly adding the error message to the public array $errorLog.
- Attempt to disable a page using the context menu in the backend.
- Notice that only the header "Exception" is shown in the flash message, but the message from the reported error is not shown. However, it is sent back to the client in the JSON array, yet saved under another key, namely "error" and not "message" as with other actions in the context menu.
The problem lies here in \TYPO3\CMS\Backend\Tree\Pagetree\ExtdirectTreeCommands (lines 33-49):
public function visiblyNode($nodeData)
{
/** @var $node PagetreeNode */
$node = GeneralUtility::makeInstance(PagetreeNode::class, (array)$nodeData);
try {
Commands::visiblyNode($node);
$newNode = Commands::getNode($node->getId());
$newNode->setLeaf($node->isLeafNode());
$returnValue = $newNode->toArray();
} catch (\Exception $exception) {
$returnValue = [
'success' => false,
'error' => $exception->getMessage()
];
}
return $returnValue;
}
All other actions in this class assign the exception message to the "message" key, which will be outputted by the evaluateResponse message in the actions.js file.
Actions