Bug #89094

Active tab could not be determined after disabling some tabs via TCEFORM

Added by Christian Stern 17 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2019-09-05
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Editor opens a tt_content element. Fields are via TCEFORM reduced to a minimum and the general (first) tab is completely disabled. The first tab, that is rendered will not get the active state.

Example based on tx_news plugin. Editor should only edit plugin and its settings but nothing else:

[page["uid"] == 1337]
    TCEFORM {
        tt_content {
            header.disabled = 1
            CType.disabled = 1
            list_type.disabled = 1

            pi_flexform {
                news_pi1 {
                    sDEF {
                        settings\.orderBy.disabled = 1
                        settings\.orderDirection.disabled = 1
                        settings\.detailPid.disabled = 1
                        settings\.listPid.disabled = 1
                        settings\.media\.maxWidth.disabled = 1
                    }
                }
            }
        }
    }
[END]

If the editor opens this element, the tab "plugin" is not opened, because the state is not set to active like it should. The editor has to click the tab, to open it. [See attached images]

The reason is located in the file typo3/sysext/backend/Resources/Private/Templates/DocumentTemplate/Tabs.html or the place that creates {items}.

Every tab is availbale inside {items} even it is empty or disabled. Thus the following condition will not work, when the first or more tabs are disabled for usage.

 {iteration.cycle} == {defaultTabIndex}

If {items} will not include not available tabs to the editor the condition would work as aspected.

Bildschirmfoto vom 2019-09-05 19-43-57.png View - The tt_content element was opened. The tab is not active. (185 KB) Christian Stern, 2019-09-05 20:53

Bildschirmfoto vom 2019-09-05 19-44-02.png View - User need to click on the tab to see its content (179 KB) Christian Stern, 2019-09-05 20:53

Bildschirmfoto vom 2019-09-05 19-43-22.png View - Debug of {items} (130 KB) Christian Stern, 2019-09-05 21:04

Also available in: Atom PDF