Issue Bug Closed

#107192Exception When Adding Multiple Search Fields to FileSearchDemand

Josua Vogel 08/01/25, 13:49 updated 12/02/25, 13:58

Description

When creating a FileSearchDemand and adding multiple search fields, an exception is thrown:

TYPO3\CMS\Core\Schema\SearchableSchemaFieldsCollector::getFields(): Argument #2 ($searchFields) must be of type array, string given, called in /usr/share/nginx/html/typo3-web/vendor/typo3/cms-core/Classes/Resource/Search/QueryRestrictions/SearchTermRestriction.php on line 60

*Background:*
The method addSearchField() expects a single search field as a string (see: TYPO3 Documentation – addSearchField).

However, later in the execution — e.g. in SearchTermRestriction via SearchableSchemaFieldsCollector->getFields() — the $searchFields parameter is expected to be an array. This leads to a type mismatch and triggers the exception.

Reviews 2

History 24

  1. Gerrit Code Review pushed patch set 1 for main to change 90220 status New Under Review 08/01/25, 13:55

  2. Gerrit Code Review pushed patch set 1 for 13.4 to change 90313 08/11/25, 10:30

  3. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % 08/11/25, 10:35

    Applied in changeset commit:ada5a93437c1b878251b29f9e4aaf749ee9b4af6.

  4. Benni Mack changed status Resolved Closed 12/02/25, 13:58