Project

General

Profile

Actions

Bug #77534

closed

Multiple Inline-CSS overrides each other

Added by Nicolas Scheidler over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2016-11-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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 432
self::addCssToPageRenderer($cssPageStyle, true); to self::addCssToPageRenderer($cssPageStyle, true, 'InlinePageCss');

/frontend/Classes/Page/PageGenerator.php at 437
self::addCssToPageRenderer($stylesFromPlugins); to self::addCssToPageRenderer($stylesFromPlugins, false, 'InlineDefaultCss');

Best regards
Nicolas

Actions #1

Updated by Nicolas Scheidler over 7 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)
Actions #2

Updated by Riccardo De Contardi over 7 years ago

  • Category set to Frontend
Actions #3

Updated by Nicolas Scheidler about 7 years ago

Still in 7.6.15

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Nicolas Scheidler about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF