Project

General

Profile

Actions

Bug #89586

closed

Date time picker JavaScript is not initialised when loading an inline record

Added by Johannes Schlier about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2019-11-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:

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.

Actions #1

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

Actions #2

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

Actions #3

Updated by Andreas Fernandez about 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF