#70782TCA displayCond fails for operator IN and comma seperated operand
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;Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.