Project

General

Profile

Actions

Bug #87650

open

Slug TCA type - Wrong date format initial

Added by András Ottó about 5 years ago. Updated about 5 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-02-04
Due date:
% Done:

0%

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

Description

The problem is that a date field (inputDateTime) is going to be transformed initially to a wrong date format like 2019-02-04t000000z

To reproduce:

I have an entity with two url relevant fields, name and date_of_birth.

The config of both:

        'name' => [
            'exclude' => 1,
            'label' => 'name',
            'config' => [
                'type' => 'input',
                'size' => 30,
                'eval' => 'trim, required',
            ],
        ],

        'date_of_birth' => [
            'label' => 'date_of_birth',
            'config' => [
                'type' => 'input',
                'renderType' => 'inputDateTime',
                'eval' => 'date, required',
                'default' => 0,
                'range' => [
                    //maximum today
                    'upper' => mktime(23, 59, 0, date('m'), date('d'), date('Y')),
                ],
            ],
        ],

The output I expect is a simple_ name-xx.xx.xxx_ url segment for this entity.

I have the following config with a slug type:

        'path_segment' => [
            'exclude' => true,
            'label' => 'path_segment',
            'config' => [
                'type' => 'slug',
                'size' => 50,
                'generatorOptions' => [
                    'fields' => ['name', 'date_of_birth'],
                    'fieldSeparator' => '-',
                    'prefixParentPageSlug' => true,
                ],
                'fallbackCharacter' => '-',
                'eval' => 'uniqueInSite',
                'default' => '',
            ],
        ],

If I have the following input by creating a new entity:

Name: András
DateOfBirth: 14-11-2018

then the problem is that this configuration results the following by saving the record:

andras-2018-11-14t000000z

If I click on the "Recalculate URL segment from page title" button it will be fixed as:
*andras-14-11-2018 *

It seems that the date conversion does not work correctly initial.

Additional Info:

- BE languages is german, website default language is german too.
- I have tested it on the frontend and unfortunately without a refresh the wrong segment will be used. (so the wrong value is saved into the database.)
- Used version: 9.5.4

Actions

Also available in: Atom PDF