Project

General

Profile

Actions

Bug #93466

closed

createVersionNumberedFilename doesn't support absolute paths

Added by Jonas Renggli over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-02-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Just discovered that files in TYPO3 Backend are lacking cache busting, e.g.

https://example.com/typo3/sysext/backend/Resources/Public/Css/backend.css

This used to work in TYPO3 8

https://example.com/typo3/sysext/backend/Resources/Public/Css/backend.css?1599168500

As far as I see, the root cause is `getRegisteredStylesheetFolders()` returning absolute file names, but `createVersionNumberedFilename` expects relative file names and therefore ignores the file completely.

public/typo3/sysext/backend/Classes/Template/ModuleTemplate.php::getRegisteredStylesheetFolders()

    /**
     * Returns an array of all stylesheet directories registered via $TBE_STYLES['skins']
     */
    protected function getRegisteredStylesheetFolders(): array
    {
        $stylesheetDirectories = [];
        foreach ($GLOBALS['TBE_STYLES']['skins'] ?? [] as $skin) {
            foreach ($skin['stylesheetDirectories'] ?? [] as $stylesheetDir) {
                $directory = GeneralUtility::getFileAbsFileName($stylesheetDir);
                if (!empty($directory)) {
                    $stylesheetDirectories[] = $directory;
                }
            }
        }
        return $stylesheetDirectories;
    }

public/typo3/sysext/core/Classes/Utility/GeneralUtility.php::createVersionNumberedFilename()


Files


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #97939: Version number is not added to filename of backend assetsClosed2022-07-14

Actions
Actions #1

Updated by Jonas Renggli over 3 years ago

IMHO the most future proof way to fix this is to extend `createVersionNumberedFilename()` and support absolute paths as well.

Actions #2

Updated by Jonas Renggli almost 2 years ago

  • Is duplicate of Bug #97939: Version number is not added to filename of backend assets added
Actions #4

Updated by Benni Mack over 1 year ago

  • Status changed from New to Closed

Thanks Jonas for the info, will close this issue now.

Actions

Also available in: Atom PDF