Bug #77534
closedMultiple Inline-CSS overrides each other
100%
Description
Hi there,
Using latest 7.6.10.
When you are on a page where some 'Default CSS' & 'Specific Page CSS' gets included and you set in your config:
removePageCss = 0 removeDefaultCss = 0 inlineStyle2TempFile = 0
The 'Default CSS' (from extensions) gets overridden by the 'Specific Page CSS'.
This only happens when inlineStyle2TempFile = 0
(CSS gets included inline and not in a external file).
You can test it by setting removePageCss = 1
. Then the PageCSS gets removed but the DefaultCSS appears as expected.
The problem:
/frontend/Classes/Page/PageGenerator.php at 1217
addCssToPageRenderer() has the parameter $inlineBlockName = 'TSFEinlineStyle'
at 1220: Parameter gets passed.
self::getPageRenderer()->addCssInlineBlock($inlineBlockName,...)
PageRenderer.php at 1503 the array key gets overridden.
public function addCssInlineBlock($name, $block, $compress = false, $forceOnTop = false) { if (!isset($this->cssInline[$name]) && !empty($block)) { $this->cssInline[$name] = array( 'code' => $block, 'compress' => $compress, 'forceOnTop' => $forceOnTop ); } }
The temp solution for me:
Set a different inlineBlockName
for the PageCSS and the DefaultCSS.
/frontend/Classes/Page/PageGenerator.php at 432self::addCssToPageRenderer($cssPageStyle, true);
to self::addCssToPageRenderer($cssPageStyle, true, 'InlinePageCss');
/frontend/Classes/Page/PageGenerator.php at 437self::addCssToPageRenderer($stylesFromPlugins);
to self::addCssToPageRenderer($stylesFromPlugins, false, 'InlineDefaultCss');
Best regards
Nicolas
Updated by Nicolas Scheidler about 8 years ago
- Priority changed from Should have to Must have
- Target version set to next-patchlevel
- Start date changed from 2016-08-18 to 2016-11-07
- PHP Version deleted (
7.0)
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51780
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51780
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51780
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51879
Updated by Gerrit Code Review over 7 years ago
Patch set 4 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51780
Updated by Nicolas Scheidler over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4e0a44f678cfa7ee154beb1932789213ece88028.