Skip to content
  • Stefan Bürk's avatar
    [BUGFIX] Use proper Postgres types on inserting / updating rows · 46fbd888
    Stefan Bürk authored and Oliver Bartsch's avatar Oliver Bartsch committed
    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/+/73636
    
    
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Tested-by: default avatarOliver Bartsch <bo@cedev.de>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
    46fbd888