Project

General

Profile

Actions

Bug #42333

closed

Flexform displayCondition

Added by Mikel no-lastname-given over 11 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2012-10-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

I just wanted to configure my flexform file with conditions.
The field should be displayed depending from a field from another tab.. that didn't work

I've already found this issue:
http://forge.typo3.org/issues/33390

In the t3lib/class.t3lib_tceforms.php on line 2530 is everything ok.
That is just how it should work.

But in the function "isDisplayCondition" it is still wrong.

if ($ffValueKey) {
    if (strpos($parts[1], 'parentRec.') !== FALSE) {
        $fParts = explode('.', $parts[1]);
        $theFieldValue = $row['parentRec'][$fParts[1]];
    } else {
        $theFieldValue = $row[$parts[1]][$ffValueKey];
    }
} else {
    $theFieldValue = $row[$parts[1]];
}

Here it still checks if the string "parentRec" is in the condition String.
It doesn't provide different tabs in conditions.

I've tried this in my flexform

<displayCond>FIELD:sDEF.switchableControllerActions:=:List->new</displayCond>

Its in another Tab than "sDEF".

I think its a bug.
But if i just made an mistake in the usage.. please correct me


Related issues 7 (0 open7 closed)

Related to TYPO3 Core - Bug #35434: displayCond does not work for Flexform SectionsRejected2012-03-31

Actions
Related to TYPO3 Core - Bug #45791: FlexForms: "displayCond" does not work with default-ValuesClosed2013-02-24

Actions
Related to TYPO3 Core - Feature #57482: FlexForms: DisplayCondition for Sheet in ExtBase Plugin Closed2014-04-01

Actions
Related to TYPO3 Core - Bug #60339: displayCond for sheets in flexform with extbase settings namespaceClosed2014-07-15

Actions
Related to TYPO3 Core - Bug #64323: Argument "displayCond" not work into other "flux:form.sheet"Closed2015-01-16

Actions
Related to TYPO3 Core - Bug #67879: Using displaycond on switchable controller actions in Flexform with TYPO3 7.3 not possibleClosedAndreas Wolf2015-07-01

Actions
Related to TYPO3 Core - Bug #68989: Sheet Flexform displayCondition logical operatorClosed2015-08-12

Actions
Actions #1

Updated by Alexander Stehlik about 10 years ago

It can be a bug or a missing feature, but it currently you can only access the field values of fields in the same sheet for field display conditions.

The values of other fields are only accessible in the sheet display conditions.

Actions #2

Updated by Wouter Wolters over 9 years ago

  • Status changed from New to Needs Feedback
  • Is Regression set to No

Hi,

does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?

Actions #3

Updated by Alexander Stehlik over 9 years ago

I can confirm that this problem still exists in the current master.

The problem is, that the \TYPO3\CMS\Backend\Form\Element\FlexElement->getSingleField_typeFlex_draw() method only knows the values of the current sheet.

This is why conditions can only match values in their own sheet.

Actions #4

Updated by Alexander Opitz almost 9 years ago

  • Status changed from Needs Feedback to New
Actions #5

Updated by Eric Chavaillaz almost 9 years ago

I can confirm this with TYPO3 7.3.1...

Thanks!

Actions #6

Updated by Christian Kuhn over 8 years ago

Is this issue fixed by #67879 ?

Actions #7

Updated by Alexander Stehlik over 8 years ago

I'm afraid the original problem is not fixed.

This is working: you can use fields from other tabs within display conditions for whole tabs, I use the felogin FlexForm as an example here:

<s_redirect>
    <ROOT>
        <TCEforms>
            <displayCond><![CDATA[FIELD:sDEF.showPermaLogin:REQ:TRUE]]></displayCond>
            <sheetTitle>LLL:EXT:felogin/locallang_db.xml:tt_content.pi_flexform.sheet_redirect</sheetTitle>
        </TCEforms>
        <type>array</type>
        ...
    </ROOT>
</s_redirect>

What is not working is using the value of a field from another tab in a field display condition.

This will work (because the field is from the same tab):

<showForgotPassword>
    <TCEforms>
        <displayCond><![CDATA[FIELD:showPermaLogin:REQ:TRUE]]></displayCond>
        <label>LLL:EXT:felogin/locallang_db.xml:tt_content.pi_flexform.show_forgot_password</label>
        ...
    </TCEforms>
</showForgotPassword>

This will not work (neither with sDEF.showPermaLogin nor with showPermaLogin):

<redirectMode>
    <TCEforms>
        <displayCond><![CDATA[FIELD:showPermaLogin:REQ:TRUE]]></displayCond>
        <label>LLL:EXT:felogin/locallang_db.xml:tt_content.pi_flexform.redirectMode</label>
        ...
    </TCEforms>
</redirectMode>

The reason for this is that the ElementConditionMatcher in the FlexFormElementContainer only gets the data from the current sheet and does not know anything about the other sheets.

Actions #8

Updated by Claus Due over 8 years ago

  • Category set to FormEngine aka TCEforms

Setting category to FormEngine like related issue #64323 - like that issue, please forgive if the category is incorrect.

I suspect this is caused by some (clearly not all!) code locations assuming a default sheet name or the displayCond logic itself somehow is unable to either detect the current sheet name and/or access values of fields in foreign sheet names. But I can't back this up with a source code location and don't currently have time to read the thousands of lines of changed code in the FormEngine.

Actions #9

Updated by Morton Jonuschat over 8 years ago

  • Status changed from New to Rejected

We discussed this in view of the recent FormEngine rewrite and decided that accessing fields from other sheets within FlexForm display conditions will not be supported.
Having access to all sheets and fields using the sheetName.fieldName syntax on the sheet level and to the fields within the current sheet on field level is the desired behavior.

If you think that closing this issue is the wrong decision please write to the mailing list typo3.teams.bugs with the issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF