Issue Bug Closed

#48213compressJs wrong filenames

Philipp Müller 05/15/13, 12:03 updated 10/23/17, 22:20

Description

Hello

If the Javascript-Compression is active (config.compressJs=1), the wrong file will be linked in frontend.

Example 1 (okay):

We activate the concatenation without compression, this will be rendered correctly.

Configuration:

config.concatenateJs = 1
config.compressJs = 0

Current output (okay):

<script src="/typo3temp/compressor/merged-095e3e9d46fe1467bd0fcc810eecfebc.1368606638.js" type="text/javascript"></script>

Example 2 (not okay):

We activate the concatenation and the compression, now we get the same output (what’s wrong).

Configuration:

config.concatenateJs = 1
config.compressJs = 1

Current output (wrong):

<script src="/typo3temp/compressor/merged-095e3e9d46fe1467bd0fcc810eecfebc.1368606638.js" type="text/javascript"></script>

Correct output:

<script src="/typo3temp/compressor/merged-095e3e9d46fe1467bd0fcc810eecfebc-2e491ef033fef81687e5e020c7445d74.js.1368606673.gzip" type="text/javascript"></script>

The error occurs in the function compressJsFiles in TYPO3\CMS\Core\Resource\ResourceCompressor. There the new filename will not be set as array-key (the array-key will be used as filename in output). In compressCssFiles this error is already fixed.

I’ve added a patch to fix this issue.

Best regards
Philipp

Reviews 4