Project

General

Profile

Actions

Bug #89908

closed

Display Frontend Editing Icons by respecting admPanel.override

Added by Paul Beck almost 5 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
AdminPanel
Target version:
-
Start date:
2019-12-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
feedit, frontend_editing
Complexity:
Is Regression:
Sprint Focus:

Description

In a current project I want to use frontend_editing.
I don't want to show the Admin Panel to the users but instead I override the admPanel options using User TSConfig:

admPanel.override.edit.displayFieldIcons = 1
admPanel.override.edit.displayIcons = 1

The TSConfig works and the options are overridden in the Admin Panel as expected.
But as I mentioned I don't want to show the Admin Panel to the users.

But the frontend editing icons are not shown to elements when the admPanel is deactivated.

The problem seems to be located in the ContentObjectRender.
E.g. typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php:7281 checks if editIcons shall be shown based on the TyposcriptFrontendController. But the TyposcriptFrontendController of the ContentObjectRender does not check the TSConfig overrides of the adminPanel to take care of admPanel.override.
The TSFE in the ContentObjectRenderer should respect those overrides as it does in typo3/sysext/adminpanel/Classes/Modules/EditModule.php:122

Due to lack of time I only can solve this with a dirty fix in the ContentObjectRenderer:7516

/**
     * @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
     */
    protected function getTypoScriptFrontendController()
    {
        // Dirty as hell, the TSFE should already be configured correctly on startup
        if($this->typoScriptFrontendController !== null) {
            $tsfe = $this->typoScriptFrontendController;
        } else {
            $tsfe = $GLOBALS['TSFE'];
        }
        $admPanelConfiguration = GeneralUtility::makeInstance(ConfigurationService::class);
        $tsfe->displayEditIcons = $admPanelConfiguration->getConfigurationOption('edit', 'displayIcons');;
        $tsfe->displayFieldEditIcons = $admPanelConfiguration->getConfigurationOption('edit', 'displayFieldIcons');
        return $tsfe;
    }
Actions

Also available in: Atom PDF