Actions
Bug #70782
closedStory #69617: FormEngine bugs
TCA displayCond fails for operator IN and comma seperated operand
Start date:
2015-10-16
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
Hi,
when setting TCA display condition e.g like this: 'displayCond' => 'FIELD:type:IN:1,2,3,4' the condition fails if e.g. the field has the value array(0=>2).
@see TYPO3\CMS\Backend\Form\FormDataProvider\EvaluateDisplayConditions::matchFieldCondition
This could solve the problem:
case 'IN': case '!IN': case '=': case '!=': if (is_array($fieldValue)) { foreach (GeneralUtility::trimExplode(',', $operand) as $operandItem) { $result = in_array($operandItem, $fieldValue); if ($result === true) { break; } } } else { $result = GeneralUtility::inList($operand, $fieldValue); } // $result = is_array($fieldValue) // ? in_array($operand, $fieldValue) // : GeneralUtility::inList($operand, $fieldValue); if ($operator[0] === '!') { $result = !$result; } break;
Updated by Morton Jonuschat about 9 years ago
- Category set to FormEngine aka TCEforms
- Status changed from New to Needs Feedback
- Target version set to 7 LTS
- Parent task set to #69617
I think this has already been fixed by #70421 on 7.6-dev? Any chance you can check if that solves your problem?
Updated by Stefan Berger about 9 years ago
Oh, I don't known about that. Yes, I checked that source and it worked for me. So task could be closed ;)
Updated by Christian Kuhn about 9 years ago
- Status changed from Needs Feedback to Closed
- % Done changed from 0 to 100
Actions