#104510Incorrect integer value: '' when creating workspace overlay with inline MM field
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
Related issues 2
History 612
-
Christian Weiske changed Related to #95513 <span data-processor="relativetime" data-value="2024-07-31T11:27:20+00:00" > 07/31/24, 11:27 </span>
-
Christian Weiske commented <span data-processor="relativetime" data-value="2024-07-31T11:36:40+00:00" > 07/31/24, 11:36 </span>
-
Garvin Hicking commented and changed status
NewNeeds 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? :-)
-
Garvin Hicking commented and changed status
Needs FeedbackClosed <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!
-
Gerrit Code Review pushed patch set 1 for main to change 92904 status
ClosedUnder Review <span data-processor="relativetime" data-value="2026-02-19T17:21:31+00:00" > 02/19/26, 17:21 </span> -
Gerrit Code Review pushed patch set 2 for main to change 92904 <span data-processor="relativetime" data-value="2026-04-21T15:11:52+00:00" > 04/21/26, 15:11 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 92904 <span data-processor="relativetime" data-value="2026-04-22T06:55:35+00:00" > 04/22/26, 06:55 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 92904 <span data-processor="relativetime" data-value="2026-09-02T05:08:55+00:00" > 09/02/26, 05:08 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 92904 <span data-processor="relativetime" data-value="2026-09-02T21:16:05+00:00" > 09/02/26, 21:16 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95602 <span data-processor="relativetime" data-value="2026-09-03T12:43:03+00:00" > 09/03/26, 12:43 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %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.
-
Benni Mack changed Related to #111474 <span data-processor="relativetime" data-value="2026-11-18T17:48:05+00:00" > 11/18/26, 17:48 </span>
Changing the SQL mode in the database connection does help: