Issue Bug Closed

#65496dbType datetime not working when using manual table mapping

Ein Geheimnis 03/03/15, 20:09 updated 05/03/16, 20:13

Description

Write to table is not working, because Extbase tries to save Unix-Timestamp instead of format ’0000-00-00 00:00:00’.

Also the property is empty when reading.

mySQL-Database with native Datetime-Field.

TCA, Model etc. was created with Extension Builder. When I use the created table instead of custom_table (without mapping),
everything works fine. So there seems to be a difference when using table-mapping.

custom_field datetime DEFAULT '0000-00-00 00:00:00',

TCA:

'custom_field' => array(
    'exclude' => 1,
    'label' => 'Datum',
    'config' => array(
        'dbType' => 'datetime',
        'type' => 'input',
        'size' => 12,
        'eval' => 'datetime',
        'checkbox' => 0,
        'default' => '0000-00-00 00:00:00'
    ),
),

Typoscript-Mapping:

MyVendor\MyExt\Domain\Model\Nachricht {
    mapping {
        tableName = custom_table
        columns {
            custom_field.mapOnProperty = antwortDatum
        }
    }            
}

Model:

    /**
     * antwortDatum
     *
     * @var \DateTime
     */
    protected $antwortDatum = NULL;

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.