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.
Updated by Riccardo De Contardi about 7 years ago
- Category set to DataHandler aka TCEmain
Updated by Tymoteusz Motylewski almost 7 years ago
- Category changed from DataHandler aka TCEmain to Pagetree
Updated by Tymoteusz Motylewski over 6 years ago
This issue is related to v8 and v7 only.
Updated by Gerrit Code Review over 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55903
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55905
Updated by Tymoteusz Motylewski over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 693a7140aa3f6eec485b9e2752174cd8e1fa6540.
Actions