Commit 4656e057 authored by Benni Mack's avatar Benni Mack Committed by Christian Kuhn
Browse files

[!!!][TASK] Remove legacy TypoScript .txt includes

Since TYPO3 v8.7 the new `.typoscript` syntax is used. See #78161 - Since then, we had

ext_typoscript_constants.typoscript
ext_typoscript_setup.typoscript
ext_typoscript_constants.txt
ext_typoscript_setup.txt
supported.

TYPO3 v12 will not include the .txt suffixes automatically
anymore.

Resolves: #96518
Releases: main
Change-Id: I51f65b6cd1db3a438660dc2abc0fed58251485ab
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72994

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent e3655fea
......@@ -813,9 +813,7 @@ class TemplateService
$extKey = $package->getPackageKey();
$packagePath = $package->getPackagePath();
$filesToCheck = [
'ext_typoscript_constants.txt',
'ext_typoscript_constants.typoscript',
'ext_typoscript_setup.txt',
'ext_typoscript_setup.typoscript',
];
$files = [];
......@@ -837,14 +835,10 @@ class TemplateService
if (!empty($files['ext_typoscript_constants.typoscript'])) {
$constants = @file_get_contents($files['ext_typoscript_constants.typoscript']);
} elseif (!empty($files['ext_typoscript_constants.txt'])) {
$constants = @file_get_contents($files['ext_typoscript_constants.txt']);
}
if (!empty($files['ext_typoscript_setup.typoscript'])) {
$config = @file_get_contents($files['ext_typoscript_setup.typoscript']);
} elseif (!empty($files['ext_typoscript_setup.txt'])) {
$config = @file_get_contents($files['ext_typoscript_setup.txt']);
}
$this->processTemplate(
......
.. include:: ../../Includes.txt
==================================================================
Breaking: #96518 - ext_typoscript_*.txt files not included anymore
==================================================================
See :issue:`96518`
Description
===========
In previous TYPO3 versions, files named :file:`ext_typoscript_setup.txt` and
:file:`ext_typoscript_constants.txt` which could be placed into an extensions'
root folder, were automatically included for all TypoScript evaluations.
This functionality stopped working, as the file ending `.typoscript`
has been unified since TYPO3 v8.
Impact
======
Contents of these files are not evaluated for TypoScript anymore.
Affected Installations
======================
TYPO3 installations with custom extensions including such files.
Migration
=========
Rename the files to `ext_typoscript_setup.typoscript` and
`ext_typoscript_constants.typoscript` which ensures compatibility
with all supported TYPO3 versions.
The file extension `.typoscript` was used since TYPO3 v8 and both versions (.txt
and .typoscript) have been working side-by-side since TYPO3 v8.
.. index:: TypoScript, NotScanned, ext:core
......@@ -506,34 +506,34 @@ class TypoScriptParserTest extends UnitTestCase
return [
'Found include file as single file is imported' => [
// Input TypoScript
'@import "EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt"'
'@import "EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript"'
,
// Expected
'
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt\' begin ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' begin ###
test.Core.TypoScript = 1
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt\' end ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' end ###
',
],
'Found include file is imported' => [
// Input TypoScript
'bennilove = before
@import "EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt"
@import "EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript"
'
,
// Expected
'
bennilove = before
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt\' begin ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' begin ###
test.Core.TypoScript = 1
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt\' end ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' end ###
',
],
'Not found file is not imported' => [
// Input TypoScript
'bennilove = before
@import "EXT:core/Tests/Unit/TypoScript/Fixtures/notfoundfile.txt"
@import "EXT:core/Tests/Unit/TypoScript/Fixtures/notfoundfile.typoscript"
'
,
// Expected
......@@ -541,23 +541,23 @@ test.Core.TypoScript = 1
bennilove = before
###
### ERROR: No file or folder found for importing TypoScript on "EXT:core/Tests/Unit/TypoScript/Fixtures/notfoundfile.txt".
### ERROR: No file or folder found for importing TypoScript on "EXT:core/Tests/Unit/TypoScript/Fixtures/notfoundfile.typoscript".
###
',
],
'All files with glob are imported' => [
// Input TypoScript
'bennilove = before
@import "EXT:core/Tests/Unit/TypoScript/Fixtures/*.txt"
@import "EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript*"
'
,
// Expected
'
bennilove = before
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt\' begin ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' begin ###
test.Core.TypoScript = 1
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt\' end ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' end ###
',
],
'Specific file with typoscript ending is imported' => [
......@@ -586,6 +586,11 @@ test.TYPO3Forever.TypoScript = 1
'
bennilove = before
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' begin ###
test.Core.TypoScript = 1
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' end ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/recursive_includes_setup.typoscript\' begin ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/setup.typoscript\' begin ###
......@@ -612,6 +617,11 @@ test.TYPO3Forever.TypoScript = 1
'
bennilove = before
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' begin ###
test.Core.TypoScript = 1
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' end ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/recursive_includes_setup.typoscript\' begin ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/setup.typoscript\' begin ###
......@@ -638,6 +648,11 @@ test.TYPO3Forever.TypoScript = 1
'
bennilove = before
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' begin ###
test.Core.TypoScript = 1
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.typoscript\' end ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/recursive_includes_setup.typoscript\' begin ###
### @import \'EXT:core/Tests/Unit/TypoScript/Fixtures/setup.typoscript\' begin ###
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment