Project

General

Profile

Actions

Bug #65496

closed

dbType datetime not working when using manual table mapping

Added by Ein Geheimnis over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-03-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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;

Actions #1

Updated by Daniel Goerz over 8 years ago

  • Status changed from New to Closed

Hello,

I am closing this ticket because the behavior you describe is not a bug in TYPO3. If you specify an alternative table for your model, make sure the TCA of the new table is there to configure the fields. If you don't configure the custom_field of custom_table to be of type dateTime in TCA there is no way the DataMapper could know hot to handle the input.

I tested your scenario with a custom_table and as soon as I add the according TCA for custom_table everything works as expected.

If you however still think this is a bug in the TYPO3 core, feel free to reopen the ticket or file a new bug report.

Actions

Also available in: Atom PDF