TYPO3:SQL 错误:'不正确的整数值:'' 列'sys_language_uid' 在第 1 行' [英] TYPO3: SQL error: 'Incorrect integer value: '' for column 'sys_language_uid' at row 1'

查看:33
本文介绍了TYPO3:SQL 错误:'不正确的整数值:'' 列'sys_language_uid' 在第 1 行'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我新设置了 TYPO3,但是当我尝试添加/保存内容时,它给了我这个错误:

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

SQL 错误:'不正确的整数值:''列'sys_language_uid'在第 1 行

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

推荐答案

该行为与使用严格模式的数据库管理系统有关,例如 MySQL 5.7 版以后.禁用严格模式(如已接受的答案中提供的那样)只是一种解决方法.

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.

真正的解决方案是通过修改相应字段定义的 TCA(表配置数组)将值显式转换为整数.

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

这篇关于TYPO3:SQL 错误:'不正确的整数值:'' 列'sys_language_uid' 在第 1 行'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆