TYPO3: SQL error: 'Incorrect integer value: '' for column 'sys_language_uid' at row 1'
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 examplett_content.starttime
- or in general for all field types it would be to define the default value using
'default' => 0
, see examplett_content.sys_language_uid
TYPO3 extension: attaching an object to an objectstorage throws a MySQL database error
If you have a Checkobject, you should use a CheckobjectRepository and add the Checkobject first.
Try:
$Kundenauftragliegtvor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('...\Kundentermine\Domain\Model\Checkobject');
$checkobjectRepository = $this-objectManager->get('...\Kundentermine\Domain\Repository\CheckobjectRepository');
$checkobjectRepository->add($Kundenauftragliegtvor);
$Kundenauftragliegtvor->setName('Kundenauftrag liegt vor');
$Kaufmnnisch->getChecklist()->attach($Kundenauftragliegtvor);
Note: You can inject the repository inside your controller too.
**
* checkobjectRepository
*
* @var ...\Kundentermine\Domain\Repository\CheckobjectRepository
*/
$protected $checkobjectRepository = null;
public function injectCheckobjectRepository(...\Kundentermine\Domain\Repository\CheckobjectRepository $checkobjectRepository) {
$this->checkobjectRepository = $checkobjectRepository;
}
If you do this change pls don't forget to clear all caches including Optcode cache.
You TCA should be configured correctly:
'checklist' => [
'exclude' => true,
'label' => 'LLL:EXT:kundentermine/Resources/Private/Language/locallang_db.xlf:tx_kundentermine_domain_model_kaufmnnisch.checklist',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_kundentermine_domain_model_checkobject',
'foreign_table_where' => ' AND tx_kundentermine_domain_model_checkobject.sys_language_uid IN (-1,0) ORDER BY tx_kundentermine_domain_model_checkobject.title',
],
Related Topics
Does SQL Server Optimize Dateadd Calculation in Select Query
Difference Between a Inline Function and a View
How to Prevent Ssis from Writing Column Names to the Flat File Output
SQL Script to Change All Table References in All Stored Procedures
How to Use a Function-Based Index on a Column That Contains Nulls in Oracle 10+
Do Clustered Index on a Column Guarantees Returning Sorted Rows According to That Column
Derby's Handling of Null Values
Running Powershell Scripts Through SQL
Is Not Null Test for a Record Does Not Return True When Variable Is Set
SQL Server Agent Job Account Issue
SQL Performance of a Lookup Table
In SQL Server, Why Is It That Null Does Not Equal Empty String and Doesn't Not Equal Empty String
MySQL Count() Multiple Columns
SQL Query to Create a Calculated Field
Reverse in Oracle This Path Z/Y/X to X/Y/Z