Project

General

Profile

Actions

Bug #98526

closed

Allow import of TypoScript files from inside a TypoScript hierarchy again

Added by Eric Harrer almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
Start date:
2022-10-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In TYPO3 9 to 11 it was possible to import TypoScript files from inside of the TypoScript hierarchy.

Example:

In the file EXT:<extension_key>/Configuration/TypoScript/setup.typoscript write the following lines to import all TypoScript files of a directory EXT:<extension_key>/Configuration/TypoScript/Setup/lib/ from inside the TypoScript object lib:

lib {
    @import 'EXT:<extension_key>/Configuration/TypoScript/Setup/lib/*.typoscript'
}

Inside of file EXT:<extension_key>/Configuration/TypoScript/Setup/lib/parseFunc.typoscript for example you could then just insert

parseFunc {
    # [...]
}

without the preceding lib. object as this has already been defined in the outer wrap.

In TYPO3 12.0.0 this no longer works.

In contrast to TypoScript Setup, this method is still possible in the TSconfig context.

If you define:

mod {
    web_layout {
        BackendLayouts {
            @import 'EXT:<extension_key>/Configuration/TsConfig/Page/mod.web_layout.BackendLayouts/*.tsconfig'
        }
    }
}

and inside of the directory EXT:<extension_key>/Configuration/TsConfig/Page/mod.web_layout.BackendLayouts/ have a file myBackendLayoutKey.tsconfig with the following content:

myBackendLayoutKey {
    title = LLL:EXT:<extension_key>/Resources/Private/Language/locallang_be.xlf:backend_layout.myBackendLayoutKey
    icon = EXT:<extension_key>/Resources/Public/Icons/BackendLayouts/myBackendLayoutKey.svg
    config {
        # [...]
    }
}

without the preceeding object chain mod.web_layout.BackendLayouts. it still works perfectly in TYPO3 12.0.0.

Unless the loss of this feature in the TypoScript Setup context is an intentional breaking change, it should be restored before the LTS version is released or at least the inconsistency with TSconfig behavior should be fixed.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #98523: Allow relative paths for importing TypoScript files againClosed2022-10-04

Actions
Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Actions #1

Updated by Christian Kuhn almost 2 years ago

need to have a look at this. Not yet sure if that's a bug we should tackle or reject.
the reason it "still" works in TSconfig is that TSconfig parsing currently still uses the old parser.

Actions #2

Updated by Christian Kuhn almost 2 years ago

  • Related to Bug #98523: Allow relative paths for importing TypoScript files again added
Actions #3

Updated by Christian Kuhn over 1 year ago

Ok, I fixed #98523. This one however is different:

Having an `@import` or an `<INCLUDE_TYPOSCRIPT:` within a "{" block has never been documented. I would assume people don't use it often and usually think of includes as always being "top level". The new parser enforces this. It would be pretty hard to allow this with the new parser structure and I'd say this is just a side-effect of the old parser internal behavior.

Following this reasoning, I'll push a patch to clearify this detail as being breaking with the v12 parser in case a project uses this.

Actions #4

Updated by Christian Kuhn over 1 year ago

Actions #5

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/+/77015

Actions #6

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/+/77015

Actions #7

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/+/77015

Actions #8

Updated by Christian Kuhn over 1 year ago

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

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF