82494[BUGFIX] Keep 'crdate' value of records when importing T3D
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 4
- typo3/sysext/core/Classes/DataHandling/DataHandler.php12+7 −2
- typo3/sysext/impexp/Tests/Functional/Fixtures/DatabaseAssertions/importPagesAndRelatedTtContentWithCrdate.csvnew+8 −0
- typo3/sysext/impexp/Tests/Functional/Fixtures/XmlImports/pages-and-ttcontent-with-crdate.xmlnew+127 −0
- typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithCrdateTest.phpnew+47 −0
Review log 2532
Show 67 earlier messages
-
Garvin Hicking uploaded patch set 1 01/17/24, 11:11
-
core-ci voted on patch set 1 V +1 01/17/24, 11:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51677
-
Oliver Klee commented on patch set 1 01/17/24, 12:05
Can we cover this with a test? -
Garvin Hicking uploaded patch set 2
V +101/17/24, 13:03Yes we can -
Oliver Klee commented on patch set 2 CR -1 01/17/24, 13:04
PagesAndTtContentWithCrdate.php:25The class name needs to end with `Test` for PHPUnit to recognize it. -
Garvin Hicking commented on patch set 2 01/17/24, 13:04
Reply
Yes. I at first didn't want to do the work before some feedback from Christian. But I figure having a test will make him look at it with a better feeling, so I added some, hope they are sufficient. If not, please let me know what I can improve. I used the existing test and fixtures as a baseline. -
Garvin Hicking uploaded patch set 3
CR -101/17/24, 13:05Rename test
-
Garvin Hicking commented on patch set 3 01/17/24, 13:06
PagesAndTtContentWithCrdate.php:25ReplyDone -
core-ci voted on patch set 2 V -1 01/17/24, 13:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51684
-
Garvin Hicking uploaded patch set 4 01/17/24, 13:11
CGL -
core-ci voted on patch set 3 V -1 01/17/24, 13:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51685
-
core-ci voted on patch set 4 V +1 01/17/24, 13:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51686
-
Oliver Klee voted on patch set 4 V +1 01/17/24, 13:18
-
Oliver Klee commented on patch set 4 01/17/24, 13:21
DataHandler.php:1090Also, what should be the behavior if the crdate is set, but is `null` or `0`?DataHandler.php:1090As `$this->isImporting` is already always a boolean and cannot have any truthy non-boolean values, we can shorten this to: ```php if ($this->isImporting && isset($incomingFieldArray[$GLOBALS['TCA'][$table]['ctrl']['crdate']])) { ``` -
Garvin Hicking uploaded patch set 5
V +101/17/24, 13:33Shorten boolean check -
Garvin Hicking commented on patch set 5 01/17/24, 13:33
DataHandler.php:1090ReplyThe XML/T3D generated does not know "null", and since crdate/tstamp shouldn't really contain "0", in this case IMO a current timestamp is useful.DataHandler.php:1090ReplyDone -
core-ci voted on patch set 5 V +1 01/17/24, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51687
-
Oliver Klee voted on patch set 5 V +1 01/17/24, 13:50
-
Oliver Klee voted on patch set 5 CR +1 01/17/24, 13:51
-
Oli Bartsch commented on patch set 5 01/17/24, 15:30
DataHandler.php:1088While already on it, could we merge the two if's? -
Garvin Hicking uploaded patch set 6
CR +1V +101/17/24, 16:04Merge one level of IF -
core-ci voted on patch set 6 V +1 01/17/24, 16:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51700
-
Garvin Hicking commented on patch set 6 01/17/24, 16:29
DataHandler.php:1088ReplyYes, sure. Usually with DataHandler I try to surgically only do the minimum changes, but in this case it should work out just fine :-) -
Stefan Bürk commented on patch set 6 01/17/24, 18:15
DataHandler.php:1090ReplyGenerally spoken, we could think about not relating this to `$this->isImporting` and instead say in a two step condition * 1: $status === new && TCA has crdate field * 2: use incomingFieldArray[crdate-field] if valid otherwise set EXEC_TIME That allows to also set normal data using datahandler without needing to set it into import mode. I had a couple of cases and project (just remembering it) where a explicit creation date was required to be set (and I had to do a update after the creation to override it again). What do you think ? Note: tsstamp should always be updated if that field exists. -
Garvin Hicking commented on patch set 6 01/17/24, 19:13
DataHandler.php:1090ReplyI was too afraid of changing FormEngine related data handling and what it could impact. Would like some feedback from more FormEngine-veterans, and this kind of feels like a possible BC then?! I don't know if any extensions could rely on the fact that crdata for "new" is always set to the current time... (I agree on tstamp, it should never be kept, and this patch doesn't change jt) -
Stefan Bürk commented on patch set 6 01/18/24, 08:22
DataHandler.php:1090ReplyFirst, DataHandler is not FormEngine only. In fact, is communicated to the way to do operations instead of doing plain stuff (at least in BE/CLI context). I would postulate that if your explicitly provide a valid value for `crdate` than you expect to have it in the database and therefore taking this as a bugfix (bugfix are always a change in behaviour in for someone eventually breaking taking a bug as a feature). But I'm fine to postpone that and doing it as a own patch in a couple of days/weeks. -
Garvin Hicking commented on patch set 6 01/18/24, 10:56
DataHandler.php:1090ReplyAlright! My FormEngine example was just meant to indicate that I wanted to restrict this chane to the Import only because I can not really oversee the impact it could have on all other casess, so it's good you broadened the scope even more. I'll leave this one open for a few more days to see if someone wants to chime in with thoughts on it. -
Garvin Hicking commented on patch set 6 01/20/24, 09:46
DataHandler.php:1090Replysee: https://typo3.slack.com/archives/C03AM9R17/p1705575487463589 This patch will thus likely be abandoned. -
Garvin Hicking rebased onto patch set 7
V +101/24/24, 12:45 -
core-ci voted on patch set 7 V +1 01/24/24, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52077
-
Stefan Bürk commented on patch set 7 01/25/24, 10:42
DataHandler.php:1090ReplyWill abandon this patch as crdate and tsstamp should be stay core controlled. -
Stefan Bürk abandoned the change 01/25/24, 10:42
Will abandon this patch as crdate and tsstamp should be stay core controlled.