Typo3: SQL Error: 'Incorrect Integer Value: '' for Column 'Sys_Language_Uid' at Row 1'

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 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 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



Leave a reply



Submit