Actions
Bug #95513
closedSQL error: 'Incorrect integer value: '' for column 'grade' at row 1'
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2021-10-07
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
Having this definition:
'grade' => [ 'exclude' => true, 'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xlf:tx_myext_domain_model_location.grade', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ ['', 0], ], 'foreign_table' => 'tx_myext_domain_model_grade', 'foreign_table_where' => 'ORDER BY tx_myext_domain_model_grade.name', ], ],
One can properly choose a "grade" in the selector and persist it. But as soon as the default empty option is selected (0), persisting the record fails with:
SQL error: 'Incorrect integer value: '' for column 'grade' at row 1' (tx_myext_domain_model_location:1)
Somehow the 0 is detected as "empty" and transformed into an empty string when sent to the database.
Actions