Bug #85945
closedAdminPanel: Missing absRefPrefix on cached requests
0%
Description
I use only config.absRefPrefix=1
in my TYPO3 instance without setting any baseUrl
. Also, I'm using the extension CoolUri for speaking URLs (without speaking URLs this issue doesn't appear).
This leads to the error that the admin panel is not displayed on cached requests, as the line which sets e.g. the JavaScript resource URL
$frontendPathExtBackend = htmlspecialchars($this->getTypoScriptFrontendController()->absRefPrefix) . ExtensionManagementUtility::siteRelPath('backend');
tries to use the absRefPrefix
set in TypoScriptFrontendController
, which is only set correctly in uncached requests where the page gets generated.
So using the admin panel in development mode works fine while using it in production mode does not because all resources (JS and CSS) are missing the "/" of the absRefPrefix
.
And again: This issue only applies to instances with speaking URLs and without defining a base URL.
Because of the rewrite of the admin panel in v9, I'm not sure if the issue will still exist over there.
Updated by Daniel Haupt about 6 years ago
A fix I've just got in mind would be to use $GLOBALS['TSFE']->config['config']['absRefPrefix']
instead of $this->getTypoScriptFrontendController()->absRefPrefix
or to generally set $this->getTypoScriptFrontendController()->absRefPrefix
for every request.
I like the first idea more as not every requests needs the admin panel.
Updated by Susanne Moog about 6 years ago
- Target version changed from 8.7.19 to Candidate for patchlevel
Updated by Daniel Haupt almost 6 years ago
If anyone else ever runs into this, here is our XClass workaround we've been using temporarily to always set the absRefPrefix for cached and uncached requests.
class AdminPanelView extends \TYPO3\CMS\Frontend\View\AdminPanelView
{
public function display()
{
// This verifies that absRefPrefix is set correctly (https://forge.typo3.org/issues/85945)
$this->getTypoScriptFrontendController()->preparePageContentGeneration();
return parent::display();
}
}
Moving our projects to v9, this workaround is not necessary anymore so I could live with closing this issue now.
Updated by Gerrit Code Review over 5 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/c/Packages/TYPO3.CMS/+/60833
Updated by Daniel Goerz about 5 years ago
- Status changed from Under Review to Rejected
8.7 is in critical bug fix phase, therefor we are rejecting this now.