Project

General

Profile

Actions

Bug #85945

closed

AdminPanel: Missing absRefPrefix on cached requests

Added by Daniel Haupt over 5 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
AdminPanel
Start date:
2018-08-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Daniel Haupt over 5 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.

Actions #2

Updated by Susanne Moog over 5 years ago

  • Target version changed from 8.7.19 to Candidate for patchlevel
Actions #3

Updated by Daniel Haupt about 5 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.

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Daniel Goerz over 4 years ago

  • Status changed from Under Review to Rejected

8.7 is in critical bug fix phase, therefor we are rejecting this now.

Actions

Also available in: Atom PDF