Project

General

Profile

Actions

Bug #81751

closed

LiveSearch in Backend broken using PostgreSQL

Added by Stephan Großberndt almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Backend API
Target version:
-
Start date:
2017-06-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
On Location Sprint

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.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #80506: Enable proper quoting of database fields in TyposcriptClosedMorton Jonuschat2017-03-28

Actions
Related to TYPO3 Core - Task #94717: Quote database identifiers in TCAClosed2021-08-05

Actions
Related to TYPO3 Core - Task #94697: Quote database identifiers when used instead of globally upfrontClosedBenni Mack2021-08-03

Actions
Actions

Also available in: Atom PDF