Project

General

Profile

Actions

Bug #90413

closed

TCA-Configuration: Input-Field with Datetime-frendertype show 'Wrong'-default value in the Backend

Added by Dieter Porth almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-02-18
Due date:
% Done:

100%

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

Description

The Backend should show the default-date `01-01-1970 00:00`. Some Definition show the Time `01-01-1970 00:*32*`
Some of the Default-Definition in the TCA of the column won't work.

            'config' => [
                'type' => 'input',
                'size' => 30,
                'eval'     => 'datetime',
                'dbType'   => 'datetime',
                'default'  => 0,    // okay 
//                'default'  => '1970-01-01 00:00:00', // wrtong shows in backend  01-01-1970 00:32
//                'default'  => SelfConst::DEFAULT_START_STOP_TSTAMP, // okay  (= 0)
//                'default'  => SelfConst::DEFAULT_START_STOP_VERSION, // wrong shows in backend  01-01-1970 00:32 (= '1970-01-01 00:00:00')
//                'default'  =>  mktime(0,0,0,1,1,1970), // shows in Backend 01-01-1970 00:00
//                'default'  => ( new \Datetime(
//                    SelfConst::DEFAULT_START_STOP_VERSION,
//                    new \DateTimeZone(SelfConst::DEFAULT_START_STOP_TIMEZONE))
//                )->getTimestamp(),  // okay 01-01-1970 00:00
//                'default'  => new \DateTime(SelfConst::DEFAULT_START_STOP_VERSION, new DateTimeZone(SelfConst::DEFAULT_START_STOP_TIMEZONE)), // disaster
//                          crash with error-message in IRRE-Element (Error 500 - Internal Server Error)
                //(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
                // PHP Catchable Fatal Error: Object of class DateTime could not be converted to string in /var/www/html/Source/web/typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowDefaultValues.php line 61

                'readOnly' => true,
            ],

P.S. The Screenshot in BUG #88450 shows the Default-Time '01.01.1970 01:33`.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #88450: Default value ist show on datetime fields by readOnlyClosed2019-05-28

Actions
Related to TYPO3 Core - Bug #89967: Invalid date representation when readOnly in TCAClosed2019-12-16

Actions
Actions #1

Updated by Dieter Porth almost 5 years ago

The missing renderType in the definition does not change the result.

Actions #2

Updated by Dieter Porth almost 5 years ago

  • Related to Bug #88450: Default value ist show on datetime fields by readOnly added
Actions #3

Updated by Dieter Porth almost 5 years ago

Sorry, forgotten
Definition of Column in Table

....
    startversion datetime DEFAULT '1970-01-01 00:00:00' COMMENT 'start-version only for information; doubled with entry in hygieneplan',
....
Actions #4

Updated by Gerrit Code Review over 4 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/+/63626

Actions #5

Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63738

Actions #6

Updated by Benni Mack over 4 years ago

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

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions #8

Updated by Oliver Bartsch about 4 years ago

  • Related to Bug #89967: Invalid date representation when readOnly in TCA added
Actions

Also available in: Atom PDF