Skip to content
Snippets Groups Projects
Commit e43bff35 authored by Stefan Bürk's avatar Stefan Bürk Committed by Oliver Bartsch
Browse files

[BUGFIX] Use proper Postgres types on inserting / updating rows

In early stage of TYPO3v11 the storage format for data
in the TCA ctrl transOrigDiffSourceField database field,
often called l18n_diffsource changed from PHP serialized
data to JSON encoded storage format with #91906, mainly
to mitigate general security risks.

doctrine/dbal enquotes json data provided as string with
backslashes if not the correct field type is provided,
which emits a postgres sql error exception when inserting
or updating these fields, which are of type 'bytea' when
dbms Postgres is used.

Various parts of the core deal with arbitrary tables and
don't know if a column is int, text or lob, or whatever.
Those are blindly updated/inserted, resulting in Postgres
saying "no".

MSSQL has been named pickier than postgres in the past on
that for similar issues with these fields. To solve this
for MSSQL a expensive workaround on several places through
the core with #81498 to get a working state and leaving it
open to find a better way with a eventual cache-layer for
these database field schema informations, thus unsolved yet.

As core suffers now from the same issue for Postgres since
the changed storage format, this patch adopts the choosen
MSSQL solution for Postgres. This is a first bugfix solution
with the tradeoff to be more expensive but working.

Additionally one test case is added to cover this issue
basicly but should be extended and further tightend in a
dedicated patch.

Improving the schema handling should be picked up and proper
engineered in a another dedicated patch.

Resolves: #96940
Related: #91906
Related: #81498
Releases: main, 11.5
Change-Id: I250fa10c9c7e06ddd330f7ab64f7680f21f3b4cd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73551


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 72d16bc3
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment