Task #80506

Enable proper quoting of database fields in Typoscript

Added by Morton Jonuschat over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Category:
TypoScript
Target version:
Start date:
2017-03-28
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Sprint Focus:
Stabilization Sprint

Description

With Doctrine supporting multiple databases using different quote character it's required to be able to use the appropriate Quoting in Typoscript.


Related issues

Related to TYPO3 Core - Bug #81492: Proper quoting of database identifiers in TypoScript doesn't work with stdWrap insertData Closed 2017-06-07
Related to TYPO3 Core - Bug #81751: LiveSearch in Backend broken using PostgreSQL Closed 2017-06-30
Duplicated by TYPO3 Core - Bug #80046: FE broken with postgres Closed 2017-02-27

Associated revisions

Revision d12cb4ec (diff)
Added by Morton Jonuschat over 2 years ago

[TASK] Allow proper quoting of database identifiers in TypoScript

Add markup to TypoScript CONTENT object options dealing with database
fields so that SQL fragments can be created in a DBMS agnostic way
using the proper quoting for the active database.

Parsing in `sortBy` and `groupBy` is disabled as these parameters
already follow a stricter syntax that allow automatic parsing and
quoting.

Usage Example: `select.where = {#colPos}=0`

Change-Id: I95592b82de08e6cb6f9e952e6c456417878c23a8
Resolves: #80506
Releases: master
Reviewed-on: https://review.typo3.org/52204
Tested-by: TYPO3com <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision c8b3703e (diff)
Added by Jigal van Hemert over 2 years ago

[BUGFIX] Skip quoted fields in insertData

While parsing the input value for expressions inside curly brackets
it must skip quoted field names which are also in curly brackets
but start with a '#'.

Resolves: #81492
Related: #80506
Releases: master, 8.7
Change-Id: Ic58fcdcbb68108ac77da746db3e6a442515ce7ea
Reviewed-on: https://review.typo3.org/53172
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 109e0c02 (diff)
Added by Jigal van Hemert over 2 years ago

[BUGFIX] Skip quoted fields in insertData

While parsing the input value for expressions inside curly brackets
it must skip quoted field names which are also in curly brackets
but start with a '#'.

Resolves: #81492
Related: #80506
Releases: master, 8.7
Change-Id: Ic58fcdcbb68108ac77da746db3e6a442515ce7ea
Reviewed-on: https://review.typo3.org/53277
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

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 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/52204

#2 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/52204

#3 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/52204

#4 Updated by Christian Kuhn over 2 years ago

  • Sprint Focus set to Stabilization Sprint

#5 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/52204

#6 Updated by Morton Jonuschat over 2 years ago

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

#7 Updated by Josef Glatz over 2 years ago

  • Related to Bug #81492: Proper quoting of database identifiers in TypoScript doesn't work with stdWrap insertData added

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

  • Related to Bug #81751: LiveSearch in Backend broken using PostgreSQL added

#9 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF