Bug #89908
closedDisplay Frontend Editing Icons by respecting admPanel.override
0%
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;
}
Updated by Paul Beck almost 5 years ago
The dirty fix 3000 super hover max will result in an error when no backend user is logged in.
The new dirty fix 4000:
/**
* @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
*/
protected function getTypoScriptFrontendController()
{
if($this->typoScriptFrontendController !== null) {
$tsfe = $this->typoScriptFrontendController;
} else {
$tsfe = $GLOBALS['TSFE'];
}
if($tsfe->isBackendUserLoggedIn() === true ) {
$admPanelConfiguration = GeneralUtility::makeInstance(ConfigurationService::class);
$tsfe->displayEditIcons = $admPanelConfiguration->getConfigurationOption('edit', 'displayIcons');;
$tsfe->displayFieldEditIcons = $admPanelConfiguration->getConfigurationOption('edit', 'displayFieldIcons');
}
return $tsfe;
}
Updated by Benni Mack almost 3 years ago
- Status changed from New to Closed
Sorry, but this code entirely went into EXT:fe_edit (https://github.com/FriendsOfTYPO3/feedit). If you still need this feature, can you open up a ticket there?