Bug #81751

LiveSearch in Backend broken using PostgreSQL

Added by Stephan Großberndt over 2 years ago. Updated about 1 year ago.

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

100%

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

Related to TYPO3 Core - Task #80506: Enable proper quoting of database fields in Typoscript Closed 2017-03-28

Associated revisions

Revision 91aa1488 (diff)
Added by Stephan Großberndt almost 2 years ago

[BUGFIX] Make quoting of SQL fragments in TCA possible

The table and column name quoting method {#tableName}.{#columnName}
introduced for TypoScript in issue #80506 is now used to quote
identifiers in TCA column definitions known to possibly contain SQL
fragments. Missing quotes for identifiers containing e.g. uppercase
letters lead to exceptions when performing a query in PostgreSQL.

In order to achieve this a new Class TcaPreparation is added as this is
not a typical TcaMigration.

Releases: master, 8.7
Resolves: #81751
Related: #80506
Change-Id: I230be317c7088e5de5343634fac507b4ab994b28
Reviewed-on: https://review.typo3.org/53360
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

Revision 86481c37 (diff)
Added by Stephan Großberndt almost 2 years ago

[BUGFIX] Make quoting of SQL fragments in TCA possible

The table and column name quoting method {#tableName}.{#columnName}
introduced for TypoScript in issue #80506 is now used to quote
identifiers in TCA column definitions known to possibly contain SQL
fragments. Missing quotes for identifiers containing e.g. uppercase
letters lead to exceptions when performing a query in PostgreSQL.

In order to achieve this a new Class TcaPreparation is added as this is
not a typical TcaMigration.

Releases: master, 8.7
Resolves: #81751
Related: #80506
Change-Id: I230be317c7088e5de5343634fac507b4ab994b28
(cherry picked from commit 91aa14884b6526dc664b6472baa27e9d802b09fc)
Reviewed-on: https://review.typo3.org/54889
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

History

#1 Updated by Stephan Großberndt over 2 years ago

  • Related to Task #80506: Enable proper quoting of database fields in Typoscript added

#2 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#3 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#6 Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#7 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#8 Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#9 Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#10 Updated by Susanne Moog over 2 years ago

  • Sprint Focus set to On Location Sprint

#11 Updated by Anja Leichsenring about 2 years ago

  • Sprint Focus deleted (On Location Sprint)

#12 Updated by Benni Mack almost 2 years ago

  • Sprint Focus set to On Location Sprint

#13 Updated by Gerrit Code Review almost 2 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#14 Updated by Gerrit Code Review almost 2 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#15 Updated by Gerrit Code Review almost 2 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#16 Updated by Gerrit Code Review almost 2 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#17 Updated by Gerrit Code Review almost 2 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#18 Updated by Gerrit Code Review almost 2 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#19 Updated by Gerrit Code Review almost 2 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#20 Updated by Gerrit Code Review almost 2 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#21 Updated by Gerrit Code Review almost 2 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53360

#22 Updated by Gerrit Code Review almost 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54889

#23 Updated by Stephan Großberndt almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#24 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF