Bug #89586
closedDate time picker JavaScript is not initialised when loading an inline record
100%
Description
It seems like the DateTimePicker is not initialised when it is loaded via Ajax as part of an inline record.
The following definition leads to this behaviour:
I have a person record 'tx_example_domain_model_person', which has the following field definition:
'vita' => [
'label' => 'CV Elements',
'config' => [
'type' => 'inline'
'foreign_table' => 'tx_example_domain_model_cvelement'
]
]
With the foreign table having a TCA definition like this:
return [
'ctrl' => [
'title' => 'CV element'
],
'columns' => [
'from' => [
'label' => 'from',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'dbType' => 'date',
'eval' => 'date'
]
],
'to' => [
'label' => 'to',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'dbType' => 'date',
'eval' => 'date'
]
],
'title' => [
'label' => 'Title',
'config' => [
'type' => 'input',
]
],
],
'types' => [
0 => ['showitem' => 'from,to,title']
]
];
When creating a new cv element within the person record, the fields are loaded via Ajax. So far, so good.
The problem lies within the date fields, which rely on their JavaScript to be loaded to work correctly.
After loading the fields via Ajax, nothing happens when clicking into the date picker field or on the date picker icon.
It seems like the JavaScript is not correctly initialised for those inline records.
DateTimePicker.ts seems to be prepared (at least according to comments within it) to initialise newly added date picker fields, but maybe it is not called after loading the inline record.
I also tested adding a slug field, which comes with JavaScript, but that doesn't seem to be affected, so it is probably a problem specific to how the InputDateTimeElement is handled for inline records.
Updated by Gerrit Code Review about 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62197
Updated by Gerrit Code Review about 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62197
Updated by Andreas Fernandez about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3471b87096fcd77ccf9021bd923eb1caf9e892ef.