Issue Bug Resolved

#92516Symfony expressions/conditions doesn't work in user-tsconfig in context menu

Dmitry Dulepov 10/08/20, 12:49 updated 10/02/26, 10:35

Description

This is the same as resolved https://forge.typo3.org/issues/86229 but appliues to the context menu only in the page tree.

How to reproduce

Install EXT:impexp (composer: typo3/cms-impexp)
Have the following in User TSConfig:

[!backend.user.isAdmin]
    options.contextMenu {
        table {
            virtual_root.tree.disableItems := addToList(importT3d,exportT3d)
            pages_root.tree.disableItems := addToList(importT3d,exportT3d)
            pages.tree.disableItems := addToList(importT3d,exportT3d)
        }
    }

The condition will work fine anywhere except when the page tree is clicked to show the context menu. In that case the user will not be detected because user context is initialized before the Backend user itself.

As a result, import export will not be shown for admin user in the context menu.

Reviews 2

History 813

  1. Simon Schaufelberger commented and changed category Complexity hard <span data-processor="relativetime" data-value="2022-04-26T21:12:27+00:00" > 04/26/22, 21:12 </span>

    I think conditions in general don’t work in TSConfig. The solution is to set different configs in different backend user groups and then assign the users to the appropriate user group.

  2. Dmitry Dulepov commented <span data-processor="relativetime" data-value="2022-04-27T10:19:39+00:00" > 04/27/22, 10:19 </span>

    In general they did work, do work and should work. This functionality is there for ages but now it has newer syntax.

    Like [4 in tree.rootLineIds] or [page["backend_layout"] == "pagets__Home"] or [usergroup("1")].

  3. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-11T13:00:15+00:00" > 09/11/26, 13:00 </span>

    Applied in changeset commit:1f09add64fbb5143f947bc33a0ff4072ec141341.

  4. Gerrit Code Review pushed patch set 2 for main to change 95727 status Resolved Under Review <span data-processor="relativetime" data-value="2026-10-01T21:25:56+00:00" > 10/01/26, 21:25 </span>

  5. Benni Mack commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-10-02T10:35:10+00:00" > 10/02/26, 10:35 </span>

    Applied in changeset commit:2bcd72c014de2c6f263e41b396f9abacccacc1d0.