Project

General

Profile

Actions

Bug #82282

closed

Error Message for "Disable" Action in the Pagetree Context Menu is Not Shown

Added by Joseph Linden over 6 years ago. Updated over 5 years ago.

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:

  1. Create a DataHandler hook (i.e. processDatamap_afterDatabaseOperations)ra
  2. Capture the disabling of the page.
  3. 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.
  4. Attempt to disable a page using the context menu in the backend.
  5. 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

Also available in: Atom PDF