From b3d7771550d62bcd4ee9b4cbf8b859ac6ed14245 Mon Sep 17 00:00:00 2001 From: Patrick Broens Date: Fri, 3 Apr 2015 17:24:53 +0200 Subject: [PATCH] [BUGFIX] Wrong url for frontend editing popup Since Forge issue #66052 frontend editing with feedit is not working anymore. This is because the URL's for modules have become absolute and feedit is adding the 'typo3' directory name in front of the module url. This patch removes the 'typo3' directory Change-Id: I26d2454240c0de5beb3a55e79d92614810670875 Resolves: #66266 Releases: master Reviewed-on: http://review.typo3.org/38463 Reviewed-by: Wouter Wolters Tested-by: Wouter Wolters Reviewed-by: Markus Klein Tested-by: Markus Klein --- Classes/FrontendEditPanel.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Classes/FrontendEditPanel.php b/Classes/FrontendEditPanel.php index aca0a99..f9fc971 100644 --- a/Classes/FrontendEditPanel.php +++ b/Classes/FrontendEditPanel.php @@ -206,7 +206,16 @@ class FrontendEditPanel { $iconTitle = $this->cObj->stdWrap($conf['iconTitle'], $conf['iconTitle.']); $iconImg = $conf['iconImg'] ? $conf['iconImg'] : ''; $nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; - $icon = $this->editPanelLinkWrap_doWrap($iconImg, BackendUtility::getModuleUrl('record_edit', array('edit[' . $table . '][' . $editUid . ']' => 'edit', 'columnsOnly' => $fieldList, 'noView' => $nV)) . $addUrlParamStr); + + $url = BackendUtility::getModuleUrl( + 'record_edit', + array( + 'edit[' . $table . '][' . $editUid . ']' => 'edit', + 'columnsOnly' => $fieldList, + 'noView' => $nV + ) + ) . $addUrlParamStr; + $icon = $this->editPanelLinkWrap_doWrap($iconImg, $url); if ($conf['beforeLastTag'] < 0) { $content = $icon . $content; } elseif ($conf['beforeLastTag'] > 0) { @@ -237,19 +246,18 @@ class FrontendEditPanel { */ protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord = '', $confirm = '', $nPid = '') { $nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; - $adminURL = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir; if ($cmd == 'edit') { $rParts = explode(':', $currentRecord); - $out = $this->editPanelLinkWrap_doWrap($string, $adminURL . BackendUtility::getModuleUrl('record_edit', array('edit[' . $rParts[0] . '][' . $rParts[1] . ']' => 'edit', 'noView=' . $nV)), $currentRecord); + $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('record_edit', array('edit[' . $rParts[0] . '][' . $rParts[1] . ']' => 'edit', 'noView=' . $nV)), $currentRecord); } elseif ($cmd == 'new') { $rParts = explode(':', $currentRecord); if ($rParts[0] == 'pages') { - $out = $this->editPanelLinkWrap_doWrap($string, $adminURL . BackendUtility::getModuleUrl('db_new', ['id' => $rParts[1], 'pagesOnly' => 1]), $currentRecord); + $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('db_new', ['id' => $rParts[1], 'pagesOnly' => 1]), $currentRecord); } else { if (!(int)$nPid) { $nPid = MathUtility::canBeInterpretedAsInteger($rParts[1]) ? -$rParts[1] : $this->frontendController->id; } - $out = $this->editPanelLinkWrap_doWrap($string, $adminURL . BackendUtility::getModuleUrl('record_edit', array('edit[' . $rParts[0] . '][' . $nPid . ']' => 'new', 'noView' => $nV)), $currentRecord); + $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('record_edit', array('edit[' . $rParts[0] . '][' . $nPid . ']' => 'new', 'noView' => $nV)), $currentRecord); } } else { if ($confirm && $this->backendUser->jsConfirmation(JsConfirmation::FE_EDIT)) {