Commit 14dc3b07 authored by Nikita Hovratov's avatar Nikita Hovratov Committed by Christian Kuhn
Browse files

[BUGFIX] Check correctly for TCA search options

The documentation states "case" and "pidonly" are
of type boolean. But in the code in_array was used
to decide, whether to utilize these options.

This is now fixed by checking for the array keys.

Some lines above in the first if-branch, this has
been already fixed.

Resolves: #96454
Releases: main, 11.5
Change-Id: I04c3638620f7a91612bdc0598ff25893325bb801
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72830


Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 84ee3e86
......@@ -2588,11 +2588,11 @@ class DatabaseRecordList
);
if (is_array($fieldConfig['search'] ?? null)) {
$searchConfig = $fieldConfig['search'];
if (in_array('case', $searchConfig, true)) {
if ($searchConfig['case'] ?? false) {
// Replace case insensitive default constraint
$searchConstraint = $expressionBuilder->andX($expressionBuilder->like($fieldName, $like));
}
if (in_array('pidonly', $searchConfig, true) && $currentPid > 0) {
if (($searchConfig['pidonly'] ?? false) && $currentPid > 0) {
$searchConstraint->add($expressionBuilder->eq($tablePidField, (int)$currentPid));
}
if ($searchConfig['andWhere'] ?? false) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment