Issue Bug Resolved

#109083Error when discarding CSV values in group fields in workspace

Benni Mack 02/24/26, 11:04 updated 10/31/26, 09:40

Description

This is what happened (“how to reproduce”):

  • We have MariaDB strict mode
  • We have a custom created group field “pages.shortcut_anchor” where one could select exactly 1 tt_content item (deeplink) only visible for a specific doktype (150) making the DB field an integer due to type=group and maxitems=1
  • A person creates a new page with doktype=150 and links to a tt_content with value 987 (example ID)
  • A person changes the value of a page from doktype = 150 to doktype = 1 and the field pages.shortcut_anchor is kept being field (classic CType toggle)
  • Another person then copies this page IN A WORKSPACE and then deletes the target (the tt_content 987 that is in that DB field) in the workspace.

We now get a DB error when deleting the tt_content element

— SQLSTATE22007: Invalid datetime format: 1366 Incorrect integer value: ‘’ for column `pages`.`shortcut_anchor` at row 1

Why?

  • The DataHandler tries to remove (discardCsvReferencesToRecord) the value 987 from all group fields in the pages table.
  • Since there can be a maximum of only 1 entry, the item gets removed in the pages.shortcut_anchor The value is then “” (empty string) as it is a CSV value, making it invalid, as the DB is strict and an integer DB table field, expecting “0”.
  • The value for the reference is fetched from sys_refindex btw.

There are multiple problems

  • The string within the DB creating this error, as it should be an integer
  • the value that is kept + stored in TCA even though the doktype forbids using this field (= the classic dilemma of CType Switch)
  • the refindex still showing this as valid reference, even though via Schema API it not listing this field as valid field anymore
  • the automatic deletion of this reference in the reference target table + field = this could lead to inconsistencies (imagine a group field with minitems=1 & maxitems=1).

Reviews 2

Files 1

History 24

  1. Benni Mack commented and changed attached discard-workspaces.patch <span data-processor="relativetime" data-value="2026-02-24T11:04:42+00:00" > 02/24/26, 11:04 </span>

    The patch just avoids the SQL error, but still, I don’t know if this is a good solution in general.

  2. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-31T09:40:12+00:00" > 10/31/26, 09:40 </span>

    Applied in changeset commit:943ce123f2ea867f348dd61fc35714a5889fcc10.