Project

General

Profile

Actions

Bug #95513

open

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

Added by Xavier Perseguers over 2 years ago. Updated 3 months ago.

Status:
New
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 2 (2 open0 closed)

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

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

Actions
Actions

Also available in: Atom PDF