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;
Actions