Bug #100205
closed@import lost the flexibility from Symfony Finder
100%
Description
The documentation mentioned `Internals: Under the hood, Symfony Finder is use to find the file and provides the "globbing" feature (* syntax).`
This implementation is lost since the deprecation of TyposcriptParser (https://review.typo3.org/c/Packages/TYPO3.CMS/+/76565). It simply uses the scandir() function in vendor/typo3/cms-core/Classes/TypoScript/IncludeTree/TreeFromLineStreamBuilder.php
My usecase was to dynamically include setup/constants for scoped extenion overrides;
In my constants.typoscript i have this;
@import 'EXT:my_package/Configuration/TypoScript/Extensions/*/constants.typoscript'
And my setup.typoscript i use a similar:
@import 'EXT:my_package/Configuration/TypoScript/Extensions/*/setup.typoscript'
This functionality is not working anymore in the new TreeFromLineStreamBuilder. As the Symfony Finder package is still widely used, I would suggest to keep using this package too.
Files
Updated by Benjamin Serfhos over 1 year ago
- File Scenario3.zip Scenario3.zip added
Updated by Benjamin Serfhos over 1 year ago
- File 100205.patch 100205.patch added
See attached patch for using Symfony Finder; this resulted into errors for others, but as far i can see the result was still as expected.
Updated by Michael Voehringer over 1 year ago
If also have the problem, that imports with wildcard characters did not work in TYPO3 12.2
Example:
@import "EXT:theme_site/Configuration/TypoScript/Library/*.setup.typoscript"
Updated by Andreas Kienast over 1 year ago
IIRC, Symfony Finder was sacrificed due to performance reasons. Perhaps @Christian Kuhn can elaborate here.
Updated by Thomas Off over 1 year ago
With TYPO3 12.3 the wildcard import still, does not work.
If performance is a thing, that's a reasonable argument, but then the docs should reflect the change and the risks/issues that come with the change.
Updated by Michael Voehringer over 1 year ago
After playing around with TYPO3 12.3 it looks like this imports does not work any more:
@import "EXT:theme_site/Configuration/TypoScript/Library/*.setup.typoscript"
But this kind of import works for me:
@import "EXT:theme_site/Configuration/TypoScript/Library/*.typoscript"
@Christian Kuhn was that a design decision or is that a bug?
Updated by Christian Kuhn over 1 year ago
- Related to Feature #97816: New TypoScript parser added
Updated by Christian Kuhn over 1 year ago
- Related to Feature #90146: TypoScript includes and imports are a real performance bottleneck and should be cached (in a prod environment) added
Updated by Christian Kuhn over 1 year ago
- Related to Feature #82812: Introduce new @import syntax for TS includes added
Updated by Christian Kuhn over 1 year ago
Wildcards in directories are not supported, this is considered invalid:
@import 'EXT:my_package/Configuration/TypoScript/Extensions/*/constants.typoscript'
A single wildcard for filenames is supported, this will be fixed:
@import "EXT:theme_site/Configuration/TypoScript/Library/*.setup.typoscript"
I'll push a patch to fix the *.something.typoscript scenario, and will adapt the ReST file at https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97816-TypoScriptSyntaxChanges.html to clarify @import restrictions.
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78331
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78331
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78331
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78331
Updated by Christian Kuhn over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 409a6ae5fb0e7dd2c1e7775b67a3723040ad9eb6.