Project

General

Profile

Actions

Bug #101947

closed

Conditions in User TSconfig do not work

Added by Georg Tiefenbrunn 9 months ago. Updated 9 months ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2023-09-19
Due date:
% Done:

0%

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

Description

I am aware that most of the User TSconfig options are only useful in the global context or can only be defined once.
Extensions using objects based on standard pages (as e.g. EXT:blog) should be able to disable e.g. unwanted actions like cut/paste or manual sorting.

Steps to reproduce:

Use ExtensionManagementUtility::addUserTSConfig() in ext_localconf.php to add User TSconfig.

Working TSconfig

options.disableDelete.pages = 1
options.contextMenu.table.pages.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
options.contextMenu.table.pages.tree.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus

Non-working TSconfig

[traverse(page, "module") == "blog"]
  options.disableDelete.pages = 1
  options.contextMenu.table.pages.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
  options.contextMenu.table.pages.tree.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
[END]
[traverse(page, "doktype") == 137]
  options.disableDelete.pages = 1
  options.contextMenu.table.pages.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
  options.contextMenu.table.pages.tree.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
[END]
[tree.pagelayout == "pagets__BlogPost"]
  options.disableDelete.pages = 1
  options.contextMenu.table.pages.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
  options.contextMenu.table.pages.tree.disableItems = pagesSort, pagesNewMultiple, hideInMenus, showInMenus
[END]

References

https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/UsingSetting/Conditions.html

It is possible to use TypoScript conditions in both user TSconfig and page TSconfig [...]

Actions #1

Updated by Christian Kuhn 9 months ago

  • Status changed from New to Rejected

https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/UsingSetting/Conditions.html#page

"All data of the current page record as array. Only available in page TSconfig, not in user TSconfig."

By nature, user tsconfig does not have the current page. I hardly see an option to change this.

Actions #2

Updated by Christian Kuhn 9 months ago

  • Status changed from Rejected to New
Actions #3

Updated by Georg Tiefenbrunn 9 months ago

By nature, user tsconfig does not have the current page. I hardly see an option to change this.

Thanks for pointing this out. Unfortunately I also see no way how to easily fix this.
Please re-reject the issue.

Actions #4

Updated by Stefan Bürk 9 months ago

  • Status changed from New to Rejected

Georg Tiefenbrunn wrote in #note-3:

By nature, user tsconfig does not have the current page. I hardly see an option to change this.

Thanks for pointing this out. Unfortunately I also see no way how to easily fix this.
Please re-reject the issue.

Rejected the request for now as requested.

Actions

Also available in: Atom PDF