Issue Bug Resolved

#104510Incorrect integer value: '' when creating workspace overlay with inline MM field

Christian Weiske 07/31/24, 11:25 updated 09/03/26, 12:45

Description

When editing the page title of a page in a workspace, I get errors:

> 2: SQL error: ‘Incorrect integer value: ‘’ for column `dbname`.`pages`.`tx_social_comments` at row 1’ (pages:NEW66aa0c9f05a82297360389)
> 1: Could not be edited in offline workspace in the branch where found (failure state: ‘Online record was not in a workspace!’). Auto-creation of version failed!

The tx_social_comments fields is added by my own extension that overrides the pages TCA:

'tx_social_comments' => [
    'label'   => 'Comments',
    'config' => [
        'type'          => 'inline',
        'allowed'       => 'tx_social_domain_model_comment',
        'foreign_table' => 'tx_social_domain_model_comment',

        'MM' => 'tx_social_parent_comment_mm',
        'MM_opposite_field' => 'parent',
        'MM_insert_fields' => [
            'tablenames' => 'pages'
        ],
        'MM_match_fields' => [
            'tablenames' => 'pages'
        ],
    ]
],

The SQL definition does not allow NULL values and forces the integer type:

CREATE TABLE pages (
  tx_social_comments int(11) NOT NULL DEFAULT '0'
);

This happens because the MySQL server is running in strict mode.

Now when switching to a workspace and editing the page title, an overlay record is created.
Unfortunately, the value for tx_social_comments is determined to be an empty string instead of 0 although this MM columns contain the number of MM records.

The code path in datahandler is

copyRecord_raw
-> copyRecord_procBasedOnFieldType
   -> copyRecord_processManyToMany
-> insertNewCopyVersion
   -> checkValue_SW
      -> checkValueForInline

checkValueForInline returns an empty array when it determines the incoming value is empty.

Configuring a TCA default => 0 and eval => int property does not help.

I report this for TYPO3 v11.5.38 but the code of checkValueForInline did not change up to TYPO3 v13.2, so I assume it is still there.

Reviews 4

History 612

  1. Christian Weiske commented <span data-processor="relativetime" data-value="2024-07-31T11:36:40+00:00" > 07/31/24, 11:36 </span>

    Changing the SQL mode in the database connection does help:

    'initCommands' => 'SET sql_mode=\'\';',
  2. Garvin Hicking commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2024-08-03T07:26:16+00:00" > 08/03/24, 07:26 </span>

    I believe this is fixed in v13 due to the TCA evaluation changes. Would you be willing to try to reproduce the issue in v13 by chance? :-)

  3. Garvin Hicking commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2024-12-22T22:37:25+00:00" > 12/22/24, 22:37 </span>

    I’m closing this due to lack of feedback. If you feel this is a mistake please follow up with more details. Thank you!

  4. Gerrit Code Review pushed patch set 1 for main to change 92904 status Closed Under Review <span data-processor="relativetime" data-value="2026-02-19T17:21:31+00:00" > 02/19/26, 17:21 </span>

  5. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-03T12:45:10+00:00" > 09/03/26, 12:45 </span>

    Applied in changeset commit:29a2547a41bd06e84e5255bd9fcdae27de48e30b.