From bb997d9c7147bc39136267a1c584ddb3e4592592 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Tue, 16 Feb 2016 23:33:32 +0100 Subject: [PATCH] [TASK] Remove leftover backPath and thumbs.php variables Resolves: #73512 Releases: master Change-Id: Ib0add5b4a07bd43a68a46d29fe0f13d448240966 Reviewed-on: https://review.typo3.org/46738 Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: Georg Ringer <georg.ringer@gmail.com> Reviewed-by: Thomas Schlumberger <thomas@b13.de> Tested-by: Thomas Schlumberger <thomas@b13.de> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> --- .../Form/Container/AbstractContainer.php | 2 +- .../Classes/Form/FormResultCompiler.php | 2 -- .../Classes/Utility/BackendUtility.php | 22 ++++++++----------- .../Resources/Public/JavaScript/FormEngine.js | 5 ++--- .../Public/JavaScript/jsfunc.tbe_editor.js | 2 -- .../Classes/Resource/ResourceCompressor.php | 2 -- .../Classes/TypoScript/ConfigurationForm.php | 11 ++-------- .../Unit/Resource/ResourceCompressorTest.php | 3 +-- .../Classes/ExtDirect/ExtDirectServer.php | 4 ++-- 9 files changed, 17 insertions(+), 36 deletions(-) diff --git a/typo3/sysext/backend/Classes/Form/Container/AbstractContainer.php b/typo3/sysext/backend/Classes/Form/Container/AbstractContainer.php index be4c49da293b..51766f36b3ef 100644 --- a/typo3/sysext/backend/Classes/Form/Container/AbstractContainer.php +++ b/typo3/sysext/backend/Classes/Form/Container/AbstractContainer.php @@ -134,7 +134,7 @@ abstract class AbstractContainer extends AbstractNode $table, $field, '', - 'thumbs.php', + '', $config['config']['uploadfolder'], 0, ' align="middle"' ) . ($absFilePath ? BackendUtility::wrapClickMenuOnIcon($fileIcon, $absFilePath, 0, 1, '', '+copy,info,edit,view') : $fileIcon) . diff --git a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php index 57f7311686e1..a6a004ad185f 100644 --- a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php +++ b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php @@ -192,7 +192,6 @@ class FormResultCompiler // set variables to be accessible for JS $pageRenderer = $this->getPageRenderer(); $pageRenderer->addInlineSetting('FormEngine', 'formName', 'editform'); - $pageRenderer->addInlineSetting('FormEngine', 'backPath', ''); return $this->JSbottom('editform'); } @@ -279,7 +278,6 @@ class FormResultCompiler $out .= ' TBE_EDITOR.formname = "' . $formname . '"; TBE_EDITOR.formnameUENC = "' . rawurlencode($formname) . '"; - TBE_EDITOR.backPath = ""; TBE_EDITOR.isPalettedoc = null; TBE_EDITOR.doSaveFieldName = "' . ($this->doSaveFieldName ? addslashes($this->doSaveFieldName) : '') . '"; TBE_EDITOR.labels.fieldsChanged = ' . GeneralUtility::quoteJSvalue($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.fieldsChanged')) . '; diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php index fb5c1d7e930e..1817fc86a732 100755 --- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php +++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php @@ -1468,7 +1468,7 @@ class BackendUtility $imgTag = '<span title="' . htmlspecialchars($fileObject->getName()) . '">' . $iconFactory->getIconForResource($fileObject, Icon::SIZE_SMALL)->render() . '</span>'; } if ($linkInfoPopup) { - $onClick = 'top.launchView(\'_FILE\',\'' . (int)$fileObject->getUid() . '\',' . GeneralUtility::quoteJSvalue($backPath) . '); return false;'; + $onClick = 'top.launchView(\'_FILE\',\'' . (int)$fileObject->getUid() . '\'); return false;'; $thumbData .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $imgTag . '</a> '; } else { $thumbData .= $imgTag; @@ -1519,7 +1519,7 @@ class BackendUtility ))->getPublicUrl(true); $image = '<img src="' . htmlspecialchars($imageUrl) . '" hspace="2" border="0" title="' . htmlspecialchars($fileObject->getName()) . '"' . $tparams . ' alt="" />'; if ($linkInfoPopup) { - $onClick = 'top.launchView(\'_FILE\', ' . GeneralUtility::quoteJSvalue($fileName) . ',\'\',' . GeneralUtility::quoteJSvalue($backPath) . ');return false;'; + $onClick = 'top.launchView(\'_FILE\', ' . GeneralUtility::quoteJSvalue($fileName) . ',\'\');return false;'; $thumbData .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $image . '</a> '; } else { $thumbData .= $image; @@ -1528,7 +1528,7 @@ class BackendUtility // Gets the icon $fileIcon = '<span title="' . htmlspecialchars($fileObject->getName()) . '">' . $iconFactory->getIconForResource($fileObject, Icon::SIZE_SMALL)->render() . '</span>'; if ($linkInfoPopup) { - $onClick = 'top.launchView(\'_FILE\', ' . GeneralUtility::quoteJSvalue($fileName) . ',\'\',' . GeneralUtility::quoteJSvalue($backPath) . '); return false;'; + $onClick = 'top.launchView(\'_FILE\', ' . GeneralUtility::quoteJSvalue($fileName) . ',\'\'); return false;'; $thumbData .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $fileIcon . '</a> '; } else { $thumbData .= $fileIcon; @@ -3187,19 +3187,17 @@ class BackendUtility * * @param string $moduleName Name of the module * @param array $urlParameters URL parameters that should be added as key value pairs - * @param bool|string $backPathOverride (unused) - * @param bool $returnAbsoluteUrl If set to TRUE, the URL returned will be absolute, $backPathOverride will be ignored in this case * @return string Calculated URL */ - public static function getModuleUrl($moduleName, $urlParameters = array(), $backPathOverride = false, $returnAbsoluteUrl = false) + public static function getModuleUrl($moduleName, $urlParameters = array()) { /** @var UriBuilder $uriBuilder */ $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); try { - $uri = $uriBuilder->buildUriFromRoute($moduleName, $urlParameters, $returnAbsoluteUrl ? UriBuilder::ABSOLUTE_URL : UriBuilder::ABSOLUTE_PATH); + $uri = $uriBuilder->buildUriFromRoute($moduleName, $urlParameters); } catch (\TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException $e) { // no route registered, use the fallback logic to check for a module - $uri = $uriBuilder->buildUriFromModule($moduleName, $urlParameters, $returnAbsoluteUrl ? UriBuilder::ABSOLUTE_URL : UriBuilder::ABSOLUTE_PATH); + $uri = $uriBuilder->buildUriFromModule($moduleName, $urlParameters); } return (string)$uri; } @@ -3213,20 +3211,18 @@ class BackendUtility * * @param string $ajaxIdentifier Identifier of the AJAX callback * @param array $urlParameters URL parameters that should be added as key value pairs - * @param bool $backPathOverride (unused) - * @param bool $returnAbsoluteUrl If set to TRUE, the URL returned will be absolute, $backPathOverride will be ignored in this case * @return string Calculated URL */ - public static function getAjaxUrl($ajaxIdentifier, array $urlParameters = array(), $backPathOverride = false, $returnAbsoluteUrl = false) + public static function getAjaxUrl($ajaxIdentifier, array $urlParameters = array()) { /** @var UriBuilder $uriBuilder */ $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); try { $routeIdentifier = 'ajax_' . $ajaxIdentifier; - $uri = $uriBuilder->buildUriFromRoute($routeIdentifier, $urlParameters, $returnAbsoluteUrl ? UriBuilder::ABSOLUTE_URL : UriBuilder::ABSOLUTE_PATH); + $uri = $uriBuilder->buildUriFromRoute($routeIdentifier, $urlParameters); } catch (\TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException $e) { // no route registered, use the fallback logic to check for a module - $uri = $uriBuilder->buildUriFromAjaxId($ajaxIdentifier, $urlParameters, $returnAbsoluteUrl ? UriBuilder::ABSOLUTE_URL : UriBuilder::ABSOLUTE_PATH); + $uri = $uriBuilder->buildUriFromAjaxId($ajaxIdentifier, $urlParameters); } return (string)$uri; } diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js index 578c12aa470c..6f2ad5e677a0 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js @@ -37,12 +37,11 @@ define(['jquery', /** * - * @type {{formName: *, backPath: *, openedPopupWindow: null, legacyFieldChangedCb: Function, browserUrl: string}} + * @type {{formName: *, openedPopupWindow: null, legacyFieldChangedCb: Function, browserUrl: string}} * @exports TYPO3/CMS/Backend/FormEngine */ var FormEngine = { formName: TYPO3.settings.FormEngine.formName - ,backPath: TYPO3.settings.FormEngine.backPath ,openedPopupWindow: null ,legacyFieldChangedCb: function() { !$.isFunction(TYPO3.settings.FormEngine.legacyFieldChangedCb) || TYPO3.settings.FormEngine.legacyFieldChangedCb(); } ,browserUrl: '' @@ -68,7 +67,7 @@ define(['jquery', * @param {Number} height height of the window */ FormEngine.openPopupWindow = setFormValueOpenBrowser = function(mode, params, width, height) { - var url = FormEngine.backPath + FormEngine.browserUrl + '&mode=' + mode + '&bparams=' + params; + var url = FormEngine.browserUrl + '&mode=' + mode + '&bparams=' + params; width = width ? width : top.TYPO3.configuration.PopupWindow.width; height = height ? height : top.TYPO3.configuration.PopupWindow.height; FormEngine.openedPopupWindow = window.open(url, 'Typo3WinBrowser', 'height=' + height + ',width=' + width + ',status=0,menubar=0,resizable=1,scrollbars=1'); diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js b/typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js index 9107512d573b..2eaa3ae89db1 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js @@ -38,8 +38,6 @@ var TBE_EDITOR = { formnameUENC: '', isChanged: 0, - backPath: '', - isPalettedoc: null, doSaveFieldName: 0, diff --git a/typo3/sysext/core/Classes/Resource/ResourceCompressor.php b/typo3/sysext/core/Classes/Resource/ResourceCompressor.php index c649109a79f1..84df70a78f99 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceCompressor.php +++ b/typo3/sysext/core/Classes/Resource/ResourceCompressor.php @@ -167,7 +167,6 @@ class ResourceCompressor if (!empty($fileOptions['excludeFromConcatenation'])) { continue; } - // we remove BACK_PATH from $filename, so make it relative to root path $filenameFromMainDir = $this->getFilenameFromMainDir($fileOptions['file']); // if $options['baseDirectories'] set, we only include files below these directories if ( @@ -229,7 +228,6 @@ class ResourceCompressor if (!isset($filesToInclude[$fileOptions['section']])) { $filesToInclude[$fileOptions['section']] = array(); } - // we remove BACK_PATH from $filename, so make it relative to root path $filenameFromMainDir = $this->getFilenameFromMainDir($fileOptions['file']); if ($fileOptions['forceOnTop']) { array_unshift($filesToInclude[$fileOptions['section']], $filenameFromMainDir); diff --git a/typo3/sysext/core/Classes/TypoScript/ConfigurationForm.php b/typo3/sysext/core/Classes/TypoScript/ConfigurationForm.php index 55bde121b00d..bf8c1a1d1e7d 100644 --- a/typo3/sysext/core/Classes/TypoScript/ConfigurationForm.php +++ b/typo3/sysext/core/Classes/TypoScript/ConfigurationForm.php @@ -52,19 +52,13 @@ class ConfigurationForm extends ExtendedTemplateService */ protected $ext_realValues = array(); - /** - * @var string - */ - protected $ext_backPath = ''; - /** * @param string $configTemplate * @param string $pathRel PathRel is the path relative to the typo3/ directory * @param string $pathAbs PathAbs is the absolute path from root - * @param string $backPath BackPath is the backReference from current position to typo3/ dir * @return array */ - public function ext_initTSstyleConfig($configTemplate, $pathRel, $pathAbs, $backPath = '') + public function ext_initTSstyleConfig($configTemplate, $pathRel, $pathAbs) { // Do not log time-performance information $this->tt_track = 0; @@ -72,8 +66,7 @@ class ConfigurationForm extends ExtendedTemplateService // The editable constants are returned in an array. $theConstants = $this->generateConfig_constants(); $this->ext_localGfxPrefix = $pathAbs; - $this->ext_localWebGfxPrefix = $backPath . $pathRel; - $this->ext_backPath = $backPath; + $this->ext_localWebGfxPrefix = $pathRel; return $theConstants; } diff --git a/typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php b/typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php index 792e1db63a2c..8cfddc5d9dbf 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php @@ -391,8 +391,7 @@ class ResourceCompressorTest extends BaseTestCase // we have to fix relative paths, if we aren't working on a file in our target directory $relativeFilename = str_replace(PATH_site, '', $cssFile); if (strpos($relativeFilename, $this->subject->_get('targetDirectory')) === false) { - $filenameRelativeToMainDir = substr($relativeFilename, strlen($this->subject->_get('backPath'))); - $compressedCss = $this->subject->_call('cssFixRelativeUrlPaths', $compressedCss, dirname($filenameRelativeToMainDir) . '/'); + $compressedCss = $this->subject->_call('cssFixRelativeUrlPaths', $compressedCss, dirname($relativeFilename) . '/'); } $this->assertEquals(file_get_contents($expected), $compressedCss, 'Group of file CSS assets optimized correctly.'); } diff --git a/typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php b/typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php index 8a851cab3744..edcb1279f1be 100644 --- a/typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php +++ b/typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php @@ -216,8 +216,8 @@ class ExtDirectServer extends AbstractHandler ); if ($configuration['type'] == 'group' && $configuration['internal_type'] == 'file') { - $versionThumb = BackendUtility::thumbCode($versionRecord, $parameter->table, $fieldName, ''); - $liveThumb = BackendUtility::thumbCode($liveRecord, $parameter->table, $fieldName, ''); + $versionThumb = BackendUtility::thumbCode($versionRecord, $parameter->table, $fieldName); + $liveThumb = BackendUtility::thumbCode($liveRecord, $parameter->table, $fieldName); $diffReturnArray[] = array( 'field' => $fieldName, 'label' => $fieldTitle, -- GitLab