Conversation
Only the global `plugin.tx_wsscss.variables` path resolved content objects.
The per-file `page.includeCSS.<key>.variables` block took the TypoScript array
verbatim, so a cObject variable (`myVar = TEXT` + `myVar.value = …`) kept its
`myVar.` sub-array. That nested array reached Compiler::compileFile(), where
`implode(',', $variables)` raised an "Array to string conversion" warning --
turned into an exception by TYPO3's error handler, i.e. a 500 in the frontend.
This is easy to hit, because copying the global block per file
(`variables < plugin.tx_wsscss.variables`) is the documented way to pass
variables to a single file, and t3bootstrap does exactly that.
Both paths now share parseTypoScriptVariables(), which renders content objects
and drops leftover sub-arrays.
Verified on TYPO3 13.4.29 / PHP 8.4.20: before the change a per-file cObject
variable throws at Compiler.php:82, after it `myVar = TEXT` + `.value = 3px`
and a nested COA both resolve to plain strings. The three setups that already
worked (global block, per-file plain values, global cObject) compile to
byte-identical CSS.
Backport of the first half of the v14 fix; the setRequest() part of that change
does not apply here, because ContentObjectRenderer::getRequest() has no
deprecated fallback in v13.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of the first half of #105 to
release/v13. The v13 branch has the same bug: only the globalplugin.tx_wsscss.variablespath resolved content objects, while the per-filepage.includeCSS.<key>.variablesblock took the TypoScript array verbatim (array_filter($subConf['variables.'] ?? []), line 140).A cObject variable (
myVar = TEXT+myVar.value = …) therefore kept itsmyVar.sub-array, which reachedCompiler::compileFile()and hitimplode(',', $variables):TYPO3's error handler turns that into an exception → HTTP 500 in the frontend. It is easy to hit, because copying the global block per file is the documented way to scope variables to a single file, and t3bootstrap does exactly that.
Both paths now share
parseTypoScriptVariables().Not backported: the
setRequest()part of #105.ContentObjectRenderer::getRequest()still has an undeprecated$GLOBALS['TYPO3_REQUEST']fallback in v13 (only a@todoin core), so that change has no effect here and is left out to keep the diff minimal.Verification
TYPO3 13.4.29-dev, PHP 8.4.20, scssphp 2.1.0. Driving
renderPreProcessorProc()with a per-file block containingcobj-test = TEXT/.value = 3px, a nestedCOA(10 = TEXT/10.value = 7,20 = TEXT/20.value = px) and a plain11px:before
after
No regression on the setups that already worked — global block, per-file plain values, and global cObject all compile to byte-identical CSS with and without the patch (
md5=9222d0fbf812c3ec0f495bea1360b9dbin all six runs).