Issue Bug Closed

#96454Wrong checks for TCA search options in DatabaseRecordList

Nikita Hovratov 01/04/22, 08:17 updated 10/04/22, 14:14

Description

The documentation states “pidonly” and “case” are boolean values.
https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/CommonProperties/Search.html

But instead of checking the keys, in_array() is used.

                    if (in_array('case', $searchConfig, true)) {
                        // Replace case insensitive default constraint
                        $searchConstraint = $expressionBuilder->andX($expressionBuilder->like($fieldName, $like));
                    }
                    if (in_array('pidonly', $searchConfig, true) && $currentPid > 0) {
                        $searchConstraint->add($expressionBuilder->eq($tablePidField, (int)$currentPid));
                    }

This has been fixed some time ago for the other if-branch some lines above, but not for this one.

Reviews 2