88834[TASK] Add internal BeforeRemoveNonCopyableFieldsEvent to DataHandler
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Garvin Hicking +1
- Stefan Bürk +1
- Christian Kuhn +1
-
Verified V +2 Done
- Benni Mack +2
- Oliver Klee +1
- Garvin Hicking +1
- Stefan Bürk +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 10
- typo3/sysext/core/Classes/DataHandling/Event/BeforeRemoveNonCopyableFieldsEvent.phpnew+61 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php8+11 −7
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/CopyRecord/PageRecordIsCopiedResult.csvnew+5 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/CopyRecord/PageRecordIsCopiedWithoutDescriptionFieldResult.csvnew+5 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/CopyRecord/Pages.csvnew+4 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/LocalizeRecord/SysCategory.csvnew+3 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/LocalizeRecord/SysCategoryRecordIsLocalizedResult.csvnew+4 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/LocalizeRecord/SysCategoryRecordIsLocalizedWithoutDescriptionFieldResult.csvnew+4 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/CopyRecordTest.phpnew+83 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/LocalizeRecordTest.phpnew+99 −0
Review log 6382
Show 4357 earlier messages
-
Torben Hansen uploaded patch set 1 03/29/25, 13:15
-
core-ci voted on patch set 1 V +1 03/29/25, 13:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76638
-
Torben Hansen commented on patch set 1 CR -1 03/29/25, 18:03
On it -
Torben Hansen uploaded patch set 2
CR -1V +103/30/25, 10:28 -
Torben Hansen uploaded patch set 3 03/30/25, 10:31
-
Georg Ringer voted on patch set 3 CR +1 V +1 03/30/25, 18:34
-
Garvin Hicking commented on patch set 3 CR +1 V +1 03/30/25, 19:59
Maybe we could adjust this to the -
Garvin Hicking commented on patch set 3 03/31/25, 06:55
Reply
Don't mind this comment, its obsolete -
Benni Mack commented on patch set 3 CR -2 04/09/25, 21:13
please wait for this, discussing with Torben -
Oli Bartsch commented on patch set 3 05/23/25, 10:24
Reply
@benni@typo3.org @derhansen@gmail.com Have you already talked about this? -
Torben Hansen commented on patch set 3 05/23/25, 11:01
Reply
@bo@cedev.de Yes,@benni@typo3.org wants to discuss the patch with @lolli@schwarzbu.ch -
Benni Mack uploaded patch set 4
CR +1V +108/15/25, 15:29Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Benni Mack commented on patch set 4 CR 0 08/15/25, 15:32
Reply
Done -
core-ci voted on patch set 4 V -1 08/15/25, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83468
-
Stefan Bürk commented on patch set 4 08/16/25, 22:22
DataHandler.php:3472Do we really want to allow that "defaultExcludeFields" are removable ? If not, that should be protected because this is possible with this event, accidently or intentionally. -
Benni Mack commented on patch set 4 08/17/25, 06:13
DataHandler.php:3472ReplyI changed this intentionally. I don’t know any use case but instead of adding another event later-on let’s make this one more powerful. that was my intention. but as with all events: you need to know what you’re doing -
Oli Bartsch commented on patch set 4 08/17/25, 08:02
DataHandler.php:3459Could we please get some tests for this event, ensuring it is called, processed and modified values influence the further program? You can search for `*EventIsCalled` for similar tests.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:14One of the main goals of PSR-14 Events is to add connivence for the developer and to abstract the actual logic in the dispatching code. This also means, using better / more speaking naming for the event methods. I've therefore proposed some changes to the current event implementation.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:30getDestinationPageId()Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:31isMainRecordToCopy(): Indicates whether this is the main record to copy, no relation or child.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:32getLanguageId()Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:33Indicates whether localization requests should be ignored.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:36We might should add `setOverrideValue(string $field, mixed $value)` to set just a single field. We might even think about an `unsetOverrideValue(string $field)`.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:37"Returns the current list of excluded fields." <= They should and are already provided as array values AFAICS.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:38array $fields. Additionally I like to also have a `setExcludeField(string $field)` to add just a single field. We might even think about an `unsetExcludeField(string $field)` for convenience. -
Torben Hansen uploaded patch set 5
V -108/22/25, 05:22 -
Torben Hansen commented on patch set 5 08/22/25, 05:22
DataHandler.php:3459ReplyI added some functional tests to test the DataHandler copy process. The tests cover usage of the new PSR-14 event, where `excludeFields` and `overrideValues` are modified.DataHandler.php:3472ReplyAgree with Benni.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:14ReplyDoneFeature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:30ReplyDoneFeature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:31ReplyDoneFeature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:32ReplyDoneFeature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:33ReplyDoneFeature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:36ReplyI think the existing methods (`getOverrideValues()`and `setOverrideValues()`) are sufficient. Developers can use them to handle single fields if needed, so I don’t see the necessity for additional convenience methods.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:37ReplyYes, this is an array already.Feature-106456-NewPSR-14BeforeCopyRecordFieldProcessingEvent.rst:38ReplyType has been changed. I think the existing methods (`getExcludeFields()`and `setExcludeFields()`) are sufficient. -
core-ci voted on patch set 5 V -1 08/22/25, 05:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83736
-
Torben Hansen rebased onto patch set 6
V -108/22/25, 06:27 -
core-ci voted on patch set 6 V -1 08/22/25, 06:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83737
-
Torben Hansen uploaded patch set 7
V -108/22/25, 06:46 -
core-ci voted on patch set 7 V -1 08/22/25, 06:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83739
-
Torben Hansen uploaded patch set 8
V -108/22/25, 06:57 -
core-ci voted on patch set 8 V -1 08/22/25, 07:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83740
-
Torben Hansen uploaded patch set 9
V -108/22/25, 07:09 -
core-ci voted on patch set 9 V -1 08/22/25, 07:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83742
-
Torben Hansen uploaded patch set 10
V -108/22/25, 07:34 -
core-ci voted on patch set 10 V -1 08/22/25, 07:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83744
-
Torben Hansen uploaded patch set 11
V -108/22/25, 08:23 -
core-ci voted on patch set 11 V +1 08/22/25, 08:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83747
-
Georg Ringer voted on patch set 11 CR +1 V +1 09/08/25, 05:21
-
Simon Schaufelberger voted on patch set 11 CR +1 V +1 09/19/25, 10:10
-
Jörg Bösche voted on patch set 11 CR +1 09/19/25, 11:28
-
Oli Bartsch commented on patch set 11 09/19/25, 14:00
Not blocking, but I’m not quite convinced adding more events to DataHandler is a good idea at this point. We still lack necessary tests, and I think @lolli@schwarzbu.ch is still in cleanup mode ;). I’m also currently evaluating how we could introduce a facade for DataHandler to enable proper command-based write operations. That said, if this brings significant benefit, please go ahead and merge — I have no objections regarding the code or functionality itself. -
Benni Mack commented on patch set 11 10/15/25, 14:46
Reply
@bo@cedev.de I chatted with Christian about this change, and we agreed this is OK to do now. -
Oli Bartsch commented on patch set 11 10/15/25, 15:23
Reply
Acknowledged -
Christian Kuhn commented on patch set 11 10/31/25, 01:20
Reply
really? i don't recall and tend to 'better not'. is it ok to chat about this again? sorry for the mess ... -
Benni Mack commented on patch set 11 12/08/25, 12:43
DataHandler.php:3470OK. Lolli and me analyzed the problem again: - So we want to exclude the fields of inline children that are not localizable, correct? - So we want to do this ONLY on localize and not on copy, right? Because with Schema API we could do this now: We loop over all fields when doing translate/localize and not on a regular copy. We check if the field is inline and not localizable, if it isn't localizable - we add it to the list of excluded fields. -
Torben Hansen commented on patch set 11 12/08/25, 12:54
DataHandler.php:3470ReplyNo, not exactly. This patch is mainly for the copy operation, but also for the localize. Basically, I want to prevent a certain field from being copied/localized in DataHandler. We had this option back in v9 (`setToDefaultOnCopy`) and I still think, it is a valid usecase to control, if a field should be excluded in a copy/localize scenario (e.g. record with "events" and inline records "event registrations" -> do not copy registrations on event copy). Therefore I think it might be useful for developers, to be able to control `$excludeFields` or `$overrideValues`. -
Torben Hansen uploaded patch set 12
CR +1V +101/13/26, 10:27 -
core-ci voted on patch set 12 V -1 01/13/26, 10:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93329
-
Torben Hansen uploaded patch set 13
V -101/16/26, 18:30 -
core-ci voted on patch set 13 V +1 01/16/26, 18:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93625
-
Philipp Kitzberger commented on patch set 13 CR +1 V +1 01/18/26, 15:42
Works like a charm! Thanks for implementing that feature, @derhansen@gmail.com -
Torben Hansen uploaded patch set 14
CR +1V +102/14/26, 10:51 -
core-ci voted on patch set 14 V +1 02/14/26, 11:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95883
-
Philipp Kitzberger voted on patch set 14 CR +1 V +1 02/15/26, 13:18
-
Torben Hansen commented on patch set 14 02/20/26, 09:58
Note: I will adapt/rework the patch, when https://review.typo3.org/c/Packages/TYPO3.CMS/+/92881 is merged. -
Torben Hansen uploaded patch set 15
CR +1V +102/24/26, 17:51 -
Torben Hansen marked it work in progress 02/24/26, 17:52
-
core-ci voted on patch set 15 V +1 02/24/26, 18:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96773
-
Torben Hansen uploaded patch set 16
V +103/11/26, 17:28 -
Torben Hansen marked it ready for review 03/11/26, 17:48
-
Torben Hansen commented on patch set 16 03/11/26, 17:49
Reply
DoneReply
DoneDataHandler.php:3470ReplyPatch adapted as discussed. -
core-ci voted on patch set 16 V +1 03/11/26, 18:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97771
-
Simon Schaufelberger uploaded patch set 17
V +103/11/26, 18:41 -
core-ci voted on patch set 17 V +1 03/11/26, 18:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97772
-
Garvin Hicking voted on patch set 17 CR +1 V +1 03/29/26, 10:32
-
Philipp Kitzberger commented on patch set 17 03/29/26, 15:57
The example implementation in the .rst file indicates that getFunctionName returns just the function name, while in reality it's class+function! Which one is it? -
Torben Hansen uploaded patch set 18
CR +1V +103/29/26, 17:34 -
Torben Hansen commented on patch set 18 03/29/26, 17:35
Reply
Good spot 👍. I changed this to `__FUNCTION__`, so now only the function name is used. -
core-ci voted on patch set 18 V -1 03/29/26, 17:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98990
-
core-ci commented on patch set 18 03/29/26, 17:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98990
-
Torben Hansen updated the commit message in patch set 19
V -103/29/26, 18:05 -
core-ci voted on patch set 19 V +1 03/29/26, 18:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98992
-
Garvin Hicking voted on patch set 19 CR +1 V +1 03/29/26, 18:33
-
Simon Schaufelberger voted on patch set 19 CR +1 V +1 03/29/26, 19:12
-
Philipp Kitzberger voted on patch set 19 CR +1 V +1 03/30/26, 09:10
-
Benni Mack commented on patch set 19 CR -2 03/30/26, 13:30
I still need to verify this again with https://review.typo3.org/c/Packages/TYPO3.CMS/+/88837 Will block this change for the time being and bring it in as exceptional feature after Feature Freeze once the details are sorted out. -
Christian Kuhn commented on patch set 19 04/10/26, 18:37
Reply
alignment with torben: despite https://review.typo3.org/c/Packages/TYPO3.CMS/+/88837 being sorted out now, we'll take the event (slightly changed) since there is especially a copy scenario that we can't circumvent currently. we'll push here again and will mark the event @internal since it will be brittle and only for special cases and for devs who know exactly what they are doing. torben will push here soon and i'll then pick up as well. -
Torben Hansen uploaded patch set 20
CR +1V +104/12/26, 05:26Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Torben Hansen commented on patch set 20 04/12/26, 05:31
Reply
Changes have been implemented as discussed and the event is not declared as `@internal`. Commit message has been adapted from [FEATURE] to [TASK], because the new event is not public API and should not be promoted in docs. -
core-ci voted on patch set 20 V +1 04/12/26, 06:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100010
-
Oliver Klee voted on patch set 20 V +1 04/12/26, 06:55
-
Benni Mack voted on patch set 20 CR +1 04/12/26, 08:45
-
Garvin Hicking voted on patch set 20 CR +1 V +1 04/12/26, 08:55
-
Christian Kuhn voted on patch set 20 CR +1 V +1 04/12/26, 10:08
-
Stefan Bürk voted on patch set 20 CR +1 V +1 04/12/26, 10:11
-
Benni Mack voted on patch set 20 CR +2 V +2 04/12/26, 10:55
-
Benni Mack merged patch set 21 04/12/26, 10:55