Project

General

Profile

Actions

Bug #106005

open

Not quite sure if it's a "feature" - displaycond has effect although the related field is not displayed when creating a new content element

Added by Michael Perlbach 13 days ago. Updated 13 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2025-01-29
Due date:
% Done:

0%

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

Description

I habe a TCA definition for a field:

'field_1' => [
'exclude' => 1,
'onChange' => 'reload',
'label' => 'LLL:EXT:ext_name/Resources/Private/Language/locallang.xlf:field_1_label',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
]
],
'default' => '1'
]
],

The default for this checkbox is "checked". However, this Checkbox is by configuration not part of my form. The reason for this is That my extension has two plugins. One Plugin that has the checkbox, the other plugin does not. Both plugins share a common tt_content.php in TCA/Overrides. And both use this text element:

'text_input' => [
'label' => 'LLL:EXT:artofffunc/Resources/Private/Language/locallang_be.xlf:text_input',
'displayCond' => 'field_1:REQ:false',
'config' => [
'type' => 'input',
'size' => 200,
],
],

As one can see I have a display condition in it which tells to show the field 'text_input' when the field 'field_1' is unchecked. I use 'text_input' in both plugins - and both plugins are based on tt_content as the database table.

So for the plugin that has 'field_1' and 'text_input' in its form 'text_input' is not shown as 'field_1' is checked by default. This is as it should be.

However, when I create a new content element of the second plugin 'text_input' is also not shown although 'field_1' is not part of its form. I would have expected that the display condition only holds when the appropriate form field is in the palette - and otherwise the display condition should not have any effect. Also the value of "field_1" is stored in the database although it is not part of the form. That is not the behaviour I expect - and it only applies to new content elements. Once it's saved and I change that value for "field_1" to 0 manually in tt_content afterwards everything works a expected from then on.

Is this a feature or a bug?

Actions #1

Updated by Garvin Hicking 13 days ago

  • Category set to FormEngine aka TCEforms
Actions

Also available in: Atom PDF