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 #1

Updated by Riccardo De Contardi over 6 years ago

  • Category set to DataHandler aka TCEmain
Actions #2

Updated by Tymoteusz Motylewski over 6 years ago

  • Category changed from DataHandler aka TCEmain to Pagetree
Actions #3

Updated by Tymoteusz Motylewski about 6 years ago

This issue is related to v8 and v7 only.

Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Gerrit Code Review about 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

Actions #6

Updated by Tymoteusz Motylewski about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF