Bug #104510
closedIncorrect integer value: '' when creating workspace overlay with inline MM field
0%
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.
Updated by Christian Weiske 6 months ago
- Related to Bug #95513: SQL error: 'Incorrect integer value: '' for column 'grade' at row 1' added
Updated by Christian Weiske 6 months ago
Changing the SQL mode in the database connection does help:
'initCommands' => 'SET sql_mode=\'\';',
Updated by Garvin Hicking 5 months ago
- Status changed from New to Needs Feedback
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? :-)
Updated by Garvin Hicking 23 days ago
- Status changed from Needs Feedback to Closed
I'm closing this due to lack of feedback. If you feel this is a mistake please follow up with more details. Thank you!