Bug #79737

Registered pageTSconfig file won't allow relative paths for include

Added by Christian Müller over 4 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2017-02-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

As described in the documentation ([[https://docs.typo3.org/typo3cms/TyposcriptSyntaxReference/Syntax/Includes/]]) you can use relative paths to include a file or a bunch of files inside a folder.
This works as expected as long as you include your TSconfig as default TSconfig by calling \ExtensionManagementUtility::addPageTSConfig() in your ext_localconf.php.

If you register your TSconfig for possible includes by calling ExtensionManagementUtility::registerPageTSConfigFile() in your /Configuration/TCA/Overrides/pages.php, relative paths for file/directory include do not work.

Example code:

# FILE: /Configuration/TSconfig/Page.ts
<INCLUDE_TYPOSCRIPT: source="FILE:./RTE.ts">
# FILE: /Configuration/TSconfig/RTE.ts
RTE >

Include of RTE.ts with relative path works:

// FILE: ext_localconf.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
    '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:foo/Configuration/TSconfig/Page.ts">'
);

Include of RTE.ts with relative path doesn't work:

// FILE: /Configuration/TCA/Overrides/pages.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
    'foo',
    'Configuration/TSconfig/Page.ts',
    'foo - PageTS'
);

To make the include work for registered TSconfig you have to use one of these:

# FILE: /Configuration/TSconfig/Page.ts
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:foo/Configuration/TSconfig/RTE.ts">

# OR:

<INCLUDE_TYPOSCRIPT: source="FILE:typo3conf/ext/foo/Configuration/TSconfig/RTE.ts">

All these examples also apply for relative paths to directories (DIR:./BackendLayouts/ extension="ts").


Related issues

Has duplicate TYPO3 Core - Bug #85825: Page TSconfig is not loaded when registering record and using relative pathsClosed2018-08-13

Actions
#1

Updated by Christian Müller over 4 years ago

  • Category set to TypoScript
#2

Updated by Ralf Merz over 4 years ago

Hi guys,

maybe not exactly the same, but I just recognized in v8.6.1:
In the TS template record, using "info / modify" there is the recommendation to use

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:site_myproject/Configuration/TypoScript/setup.ts">

Now I noticed that this does not work, but this:

<INCLUDE_TYPOSCRIPT: source="FILE:typo3conf/ext/site_myproject/Configuration/TypoScript/setup.ts">

So "EXT:" cannot be used somehow.

Is this related here or should this be a new issue?

Cheers
merzilla

#3

Updated by Markus Kobligk about 4 years ago

I can confirm the behaviour described in the OP under TYPO3 8.7.1

Nested including of TS files does not work when the original file is loaded with ExtensionManagementUtility::registerPageTSConfigFile(),
no matter if that function call is placed in Configuration/TCA/Overrides/pages.php or in the ext_tables.php.

#4

Updated by Christian Müller almost 4 years ago

  • TYPO3 Version changed from 7 to 8
  • PHP Version set to 7.0
#5

Updated by Georg Ringer over 1 year ago

  • Has duplicate Bug #85825: Page TSconfig is not loaded when registering record and using relative paths added

Also available in: Atom PDF