[FEATURE] TypoScript: Allow relative file inclusion
Allows to pass relative paths to INCLUDE_TYPOSCRIPT if the inclusion is called recursively from a file. Those paths start with ./ or ../ The ./ is needed to distinguish them from paths relative to PATH_SITE. Adds a new utility function to PathUtility that does the actual resolving. The utility function ships with a unit test. This allows simple nested TypoScript templates that can be moved or copied without the need to adapt all includes. Relative paths will also remain unchanged between loading/saving. Besides this the patch now also keeps "optional properties" given in an include-tag for FILE unchanged. So far this only worked for DIR. Resolves: #52018 Documentation: #52832 Releases: 6.2 Change-Id: Icfb828152076ad285bd145f55f2aabcea89c50d0 Reviewed-on: https://review.typo3.org/23842 Reviewed-by: Philipp Gampe Tested-by: Philipp Gampe
Showing
- typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php 53 additions, 16 deletions...ysext/core/Classes/TypoScript/Parser/TypoScriptParser.php
- typo3/sysext/core/Classes/Utility/PathUtility.php 31 additions, 0 deletionstypo3/sysext/core/Classes/Utility/PathUtility.php
- typo3/sysext/core/Tests/Unit/Utility/PathUtilityTest.php 42 additions, 0 deletionstypo3/sysext/core/Tests/Unit/Utility/PathUtilityTest.php
Please register or sign in to comment