Issue Bug Closed

#81751LiveSearch in Backend broken using PostgreSQL

Stephan Großberndt 06/30/17, 08:16 updated 10/02/18, 10:58

Description

Using the Backend LiveSearch in PostgreSQL is currently not possible as invoking it creates an exception.

The search condition 'andWhere' => 'CType=\'text\' OR CType=\'textpic\' OR CType=\'textmedia\'' of field bodytext in table tt_content kills it when using PostgreSQL because the fieldname CType (note the uppercase letters) is not escaped, PostgreSQL assumes the field to be lowercase then and does not find a field named ctype. The correct escaping depends on the database driver (MySQL uses backticks, PostgreSQL uses double quotes).

        'bodytext' => [
            'l10n_mode' => 'prefixLangTitle',
            'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.text',
            'config' => [
                'type' => 'text',
                'cols' => '80',
                'rows' => '15',
                'softref' => 'typolink_tag,images,email[subst],url',
                'search' => [
                    'andWhere' => 'CType=\'text\' OR CType=\'textpic\' OR CType=\'textmedia\''
                ]
            ]
        ],

In issue #80506 a solution was implemented to fix such issues in TypoScript. This can be adapted to be used in TCA ‘andWhere’ conditions.

Reviews 2