Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have newly setup TYPO3, but when I try to add/save content, it gives me this error:

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

like image 373
Bharat Parmar Avatar asked Nov 11 '16 06:11

Bharat Parmar


3 Answers

The behavior is related to database management systems using strict mode, like MySQL since version 5.7. Disabling strict mode (like provided in the accepted answer) is just a work around.

The real solution would be to explicitly cast values to integer by modifying TCA (table configuration array) for the according field definitions.

  • for fields of type input that would be setting/extending 'eval' => 'int', see example tt_content.starttime
  • or in general for all field types it would be to define the default value using 'default' => 0, see example tt_content.sys_language_uid
like image 154
Oliver Hader Avatar answered Oct 17 '22 11:10

Oliver Hader


set this in Localconfiguration.php file

[SYS][setDBinit] = SET SESSION sql_mode=''
like image 8
Pravin Vavadiya Avatar answered Oct 17 '22 10:10

Pravin Vavadiya


For me, after trying different approaches, the solution was:

mysql -u root -p -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';" 

Then, you can verify that the mode is set by running the following:

 mysql -u root -p -e "SELECT @@GLOBAL.sql_mode;"

And you should see:

+---------------+------------------------+
| Variable_name | Value                  |
+---------------+------------------------+
| sql_mode      | NO_ENGINE_SUBSTITUTION |
+---------------+------------------------+
like image 1
achasinh Avatar answered Oct 17 '22 12:10

achasinh