Review 11.5 Merged

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

Oli Bartsch CR +2 V +2 Normal +72 −12 updated 02/22/22, 09:06

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 3

Files 7