Project

General

Profile

Actions

Bug #95513

closed

SQL error: 'Incorrect integer value: '' for column 'grade' at row 1'

Added by Xavier Perseguers about 3 years ago. Updated 5 months ago.

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.


Related issues 3 (2 open1 closed)

Related to TYPO3 Core - Bug #91731: Cannot empty a date field in TCEforms if MySQL is in strict modeClosed2020-06-30

Actions
Related to TYPO3 Core - Bug #78921: Copying records fails with SQL error without any messageNew2016-12-08

Actions
Related to TYPO3 Core - Bug #104510: Incorrect integer value: '' when creating workspace overlay with inline MM fieldNeeds Feedback2024-07-31

Actions
Actions

Also available in: Atom PDF