Project

General

Profile

Actions

Bug #104365

open

page.tsconfig vs. ExtensionManagementUtility::addPageTSConfig

Added by Christoph Erdmann 5 months ago. Updated 4 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2024-07-11
Due date:
% Done:

0%

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

Description

Starting with TYPO3 12 it is possible to add a file page.tsconfig in my_ext/Configuration (see https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/UsingSetting/PageTSconfig.html#pagesettingdefaultpagetsconfig).

To be compatible with TYPO3 11.5, one can add ExtensionManagementUtility::addPageTSConfig() in ext_localconf.php .

I am interpreting the docs in the way, that both ways can be used equally. As I don't have to be compatible with 11.5 I opted to use page.tsconfig .

BUT:
When using ExtensionManagementUtility::addPageTSConfig() the resulting TSConfig is other than when using page.tsconfig . Namely I want to override the backend layouts provided by the extension bootstrap_package. I am trying to unset all but one layout and change the config of that layout.

When using ExtensionManagementUtility::addPageTSConfig() the unsetting and overriding works as expected, when using page.tsconfig the unsetting and overriding is not working at all but new properties are merged into the config.

Entry file:

[1 in tree.rootLineParentIds]
@import 'EXT:sitepackage/Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts.tsconfig'

# remove unused backend layouts
mod {
    web_layout {
        BackendLayouts {
            2_columns >
            2_columns_25_75 >
            2_columns_50_50 >
            2_columns_offset_right >
            3_columns >
            simple >
            special_feature >
            special_start >
            subnavigation_left >
            subnavigation_left_2_columns >
            subnavigation_right >
            subnavigation_right_2_columns >
        }
    }
}
[END]

Backend layout config: (BackendLayouts.tsconfig)

################################
#### BACKENDLAYOUT: DEFAULT ####
################################
mod {
    SHARED.colPos_list = ...
    web_layout {
        BackendLayouts {
            default {
                title = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.default
                config {
                    backend_layout {
                        rowCount = 6
                        rows {
                            ...
                            3 {
                                columns {
                                    1 {
                                        name = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.column.normal
                                        colPos = 0
                                        colspan = 12
                                    }
                                }
                            }
                            ...
                            6 {
                                columns {
                                    1 {
                                        name = LLL:EXT:sitepackage/Resources/Private/Language/backend.xlf:backend_layout.column.footerafter
                                        colPos = 13
                                        colspan = 12
                                    }
                                }
                            }
                        }
                    }
                }
                icon = EXT:bootstrap_package/Resources/Public/Icons/BackendLayouts/default.svg
            }
        }
    }
}

Result with page.tsconfig

  • backend layouts are NOT removed (e. g. 2_columns >)
  • mod.SHARED.colPos_list is added
  • rows.6 is added
  • config.backend_layout.rowCount is '5' in bootstrap_package, but gets NOT overridden with '6' as intended
  • changed name of 3.columns.1.name for testing, but is not overriden either

Result with ExtensionManagementUtility::addPageTSConfig()

  • backend layouts are removed (e. g. 2_columns >)
  • mod.SHARED.colPos_list is added
  • rows.6 is added
  • config.backend_layout.rowCount gets overridden with '6'
  • name of 3.columns.1.name gets overridden

Question: Is there a difference between the processing of page.tsconfig and ExtensionManagementUtility::addPageTSConfig()?

Actions #1

Updated by Garvin Hicking 5 months ago

  • Category changed from Miscellaneous to System/Bootstrap/Configuration

I can't answer the question right now, but to possibly reproduce this, can you tell if your extension lists bootstrap_package as a dependency, so the loading order should be proper?

Actions #2

Updated by Christoph Erdmann 4 months ago

Yes, the extension bootstrap_package has been correctly defined as dependency.

Actions

Also available in: Atom PDF