83713[FEATURE] Add record list download presets
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oli Bartsch +1
- Garvin Hicking +1
-
Verified V +2 Done
- Benni Mack +2
- Oli Bartsch +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 17
- typo3/sysext/backend/Classes/Controller/RecordListDownloadController.php10+37 −4
- typo3/sysext/backend/Classes/RecordList/Event/BeforeRecordDownloadIsExecutedEvent.phpnew+111 −0
- typo3/sysext/backend/Classes/RecordList/Event/BeforeRecordDownloadPresetsAreDisplayedEvent.phpnew+90 −0
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php10+58 −2
- typo3/sysext/backend/Classes/RecordList/DownloadPreset.phpnew+68 −0
- typo3/sysext/backend/Classes/RecordList/DownloadRecordList.php+9 −0
- typo3/sysext/backend/Resources/Private/Language/locallang_download.xlf+3 −0
- typo3/sysext/backend/Resources/Private/Templates/RecordDownloadSettings.html11+13 −0
- typo3/sysext/backend/Tests/Functional/RecordList/DownloadRecordListTest.php+234 −0
- typo3/sysext/backend/Tests/Unit/RecordList/Event/BeforeRecordDownloadIsExecutedEventTest.phpnew+99 −0
- typo3/sysext/backend/Tests/Unit/RecordList/Event/BeforeRecordDownloadPresetsAreDisplayedEventTest.phpnew+189 −0
- typo3/sysext/core/Documentation/Changelog/13.2/Deprecation-102337-DeprecateHooksForRecordDownload.rstnew+50 −0
- typo3/sysext/core/Documentation/Changelog/13.2/Feature-102337-IntroducePSR14EventModifyRecordListDownloadData.rstnew+132 −0
- typo3/sysext/core/Documentation/Changelog/13.2/Feature-102337-IntroducePSR14EventModifyRecordListDownloadPresets.rstnew+105 −0
- typo3/sysext/core/Documentation/Changelog/13.2/Feature-102337-PresetsForRecordListDownload.rstnew+99 −0
- typo3/sysext/core/Tests/Acceptance/Application/RecordList/RecordDownloadWithPresetCest.phpnew+109 −0
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php+12 −0
Review log 5579
Show 3854 earlier messages
-
Garvin Hicking uploaded patch set 1 04/09/24, 07:26
-
core-ci voted on patch set 1 V +1 04/09/24, 07:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55590
-
Jörg Bösche voted on patch set 1 CR +1 04/11/24, 13:34
-
Chris Müller uploaded patch set 2
CR +1V +104/13/24, 17:01 -
core-ci voted on patch set 2 V +1 04/13/24, 17:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55916
-
Guido Schmechel commented on patch set 2 04/14/24, 13:07
RecordDownloadSettings.html:53I once tested this with a very long preset name. Presumably it makes sense to limit the number of characters in the preset using CSS? An Edge case, of courseFeature-102337-PresetsForRecordListDownload.rst:64bodytext for pages? Maybe choose a different field name to avoid confusion? -
Garvin Hicking commented on patch set 2 04/14/24, 15:59
(also thanks @chris for rst work!)DatabaseRecordList.php:474ReplyGood idea. Will refactor to something like "applyPresetToColumbo($columnsToRender)". Then the early returns make more sense in a dedicated method.RecordDownloadSettings.html:53ReplyI'm not to great with CSS but I'll see if an easy max-width on the select can work.Feature-102337-PresetsForRecordListDownload.rst:64ReplyHaha. A leftover from my early test cases where I checked if invalid columns work properly. Makes no sense here, good catch, thanks! -
Garvin Hicking uploaded patch set 3
V +104/15/24, 14:38Refactoring -
Garvin Hicking commented on patch set 3 04/15/24, 14:43
DatabaseRecordList.php:474ReplyDoneRecordDownloadSettings.html:53ReplyLooks as if just omitting "w-auto" here allows to render a large select properly...Feature-102337-PresetsForRecordListDownload.rst:64ReplyDone -
core-ci voted on patch set 3 V +1 04/15/24, 14:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55997
-
Georg Ringer voted on patch set 3 CR +1 V +1 04/15/24, 17:30
-
Benni Mack commented on patch set 3 04/15/24, 18:46
looks really cool - and I have this use-case quite often. It would be also cool to have like a "processor" option (a registered service) where the data can be processed / filtered before being sent to the output. -
Garvin Hicking commented on patch set 3 04/15/24, 19:09
Reply
Thanks for the feedback! I have this ability to post-process response data on my todo-list already actually. But wanted it as a separate PR. Introducing a PSR-14 event there shouldn't be hard. If this patch gets through I can start work on it... - waiting for Oli to recover from surfing so I can ping him about it :-) Do you think a PSR-14 event for manipulating the Preset-list itself is worthwile, or is TSconfig sufficient? I'm unsure about unneccessary complexity for this feature. -
Benni Mack commented on patch set 3 04/15/24, 19:20
Reply
Yes, an Event might be even better -
Henrik Ziegenhain voted on patch set 3 CR +1 V +1 05/06/24, 08:38
-
Benni Mack commented on patch set 4
CR +1V +105/06/24, 14:49Published edit on patch set 3. -
core-ci voted on patch set 4 V +1 05/06/24, 14:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57293
-
Garvin Hicking commented on patch set 4 05/06/24, 15:11
Reply
I found out there's a hook already for modifying CSV data (not the query/fields though IIRC) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList']['customizeCsvRow'] I could add a new PSR-14 event and we could add a deprecation to the hook for the next version. Also I would add a PSR-14 event to modify/add/remove presets through an event (instead of only TSConfig). Still working on it, albeit a bit short on time for the next 1-2 weeks. -
Garvin Hicking uploaded patch set 5
V +105/13/24, 12:40Add PSR 14 event for preset manipulation -
core-ci voted on patch set 5 V -1 05/13/24, 12:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57620
-
Garvin Hicking uploaded patch set 6
V -105/13/24, 13:03Fix request parameter in test -
core-ci voted on patch set 6 V +1 05/13/24, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57622
-
Garvin Hicking uploaded patch set 7
V +105/13/24, 16:27Add another PSR14 event and deprecate old hooks -
core-ci voted on patch set 7 V +1 05/13/24, 16:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57634
-
Garvin Hicking commented on patch set 7 05/13/24, 16:35
Reply
Thanks to being ill I could finally work on this :D Now implemented two PSR-14 events both for the data processing/download and the preset manipulation, with some tests. I've never replaced a hook with an PSR-14 event and hope this kind of deprecation (and non-removal) is ok for the v13 LTS release process. -
Benni Mack commented on patch set 7 06/03/24, 07:16
In general, I would rename the Event in a way that reflects WHEN the event is fired "BeforeRecordListExportIsSent" instead of "Modify..." - Modify is what the Event Listener is doing, not the Event itself.RecordListDownloadController.php:89can be readonlyModifyRecordListDownloadDataEvent.php:43do you have an example where the request can be null?ModifyRecordListDownloadPresetEvent.php:37Can the request be null? -
Garvin Hicking uploaded patch set 8
V +106/03/24, 10:44apply code review suggestions -
Garvin Hicking commented on patch set 7 06/03/24, 10:46
Reply
Thanks for the idea. I just adhered to the other events that were in this directory (`ModifyRecordListHeaderColumns`, `ModifyRecordListRecordActions`, `ModifyRecordListTableActions`), but I agree that the Before/After terminology is better.RecordListDownloadController.php:89ReplyDoneModifyRecordListDownloadDataEvent.php:43ReplyYou're right, this shouldn't be nullable.ModifyRecordListDownloadPresetEvent.php:37Replysame, shouldn't be nullable. -
core-ci voted on patch set 8 V -1 06/03/24, 10:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58617
-
Garvin Hicking uploaded patch set 9
V -106/03/24, 11:49Fix phpdoc -
core-ci voted on patch set 9 V +1 06/03/24, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58619
-
Benni Mack voted on patch set 9 V +1 06/03/24, 21:25
-
Georg Ringer voted on patch set 9 CR +1 V +1 06/06/24, 23:40
-
Henrik Ziegenhain voted on patch set 9 CR +1 06/07/24, 18:21
-
Benni Mack commented on patch set 9 CR -1 06/07/24, 19:50
one few last remarks: mod.web_list.recordListDownloadPresets -> let's call it mod.web_list.downloadPresets and -> how about one Feature.RST for the both PSR-14 Events? -
Garvin Hicking commented on patch set 9 06/08/24, 01:32
Reply
I can rename this, yes - was too afraid it may sound too broad without a restriction to the recordList, but it does look nicer when shorter. ;) About the feature rsts though IMO its easier to read when one one event is addressed, so that examples are not easily confused and the focus is clearer, I'd prefer distinct files here. Would also make later doc linking be more specific...? -
Benni Mack commented on patch set 9 06/09/24, 15:20
let's keep the two RSts then. You're the docs guy!Reply
let's keep the two RSts then. You're the docs guy! please rename the option though -
Garvin Hicking uploaded patch set 10
CR +1V +106/09/24, 19:06Rename recordListDownloadPresets to downloadPresets -
Garvin Hicking commented on patch set 10 06/09/24, 19:07
Reply
Done -
core-ci voted on patch set 10 V -1 06/09/24, 19:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58958
-
core-ci voted on patch set 10 V +1 06/09/24, 19:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58958
-
Benni Mack voted on patch set 10 CR +1 V +1 06/09/24, 19:51
-
Oli Bartsch commented on patch set 10 CR -1 06/10/24, 09:27
Reviewing -
Garvin Hicking updated the commit message in patch set 11
CR +1V +106/10/24, 12:02fix typo in commit msg -
core-ci voted on patch set 11 V +1 06/10/24, 12:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59003
-
Oli Bartsch uploaded patch set 12
V +106/10/24, 14:40 -
core-ci voted on patch set 12 V +1 06/10/24, 14:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59018
-
Oli Bartsch uploaded patch set 13
V +106/10/24, 14:46 -
core-ci voted on patch set 13 V +1 06/10/24, 14:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59019
-
Oli Bartsch uploaded patch set 14
V +106/10/24, 15:42 -
Garvin Hicking uploaded patch set 15 06/10/24, 15:51
Use value object for preset transfer -
core-ci voted on patch set 15 V -1 06/10/24, 16:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59045
-
core-ci voted on patch set 14 V +1 06/10/24, 16:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59042
-
Garvin Hicking uploaded patch set 16
V -106/10/24, 16:04CGL
-
core-ci voted on patch set 16 V -1 06/10/24, 16:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59048
-
Oli Bartsch commented on patch set 16 CR -1 06/10/24, 16:17
RecordListDownloadController.php:177Those variable assignments could be skipped.RecordListDownloadController.php:198Lets do the transformation in the event in the setPresets method and call this method in the constructor => So we ensure on creating the event, the data is correct and also when listeners update the data is correct. This should be covered with a test.RecordListDownloadController.php:200Should we include the $id as well?DatabaseRecordList.php:493Transformation to RecordListDownloadPreset is missing hereDatabaseRecordList.php:497So label is used as an identifier here. I would like to use a separat logic for this. Especially because I would like to have the label being able to use locallang.DatabaseRecordList.php:507At this point it has still not been validated whether the string is a valid comma-separated listRecordListDownloadPreset.php:22Let's call this just DownloadPresetRecordListDownloadPreset.php:24The properties should not be optional (having a default value)RecordListDownloadPreset.php:26This should be an arrayRecordListDownloadPreset.php:48Having no label should trigger an error as we currently need it for display and also for evaluation in the getColumnsToRender() method.RecordListDownloadPreset.php:82Let's use instanceof.RecordDownloadSettings.html:53This should be translateableRecordDownloadSettings.html:57Please remove this as we should not force devs to add presets for every table. Also editors (which see this message) are usually not able to handle this and might not understand the message at all => just leading to confusion. -
Garvin Hicking commented on patch set 16 06/10/24, 16:38
Thank you for the very detailed feedback, Oliver. I'll address this, but it'll take some time. For some of them I gave some feedback, everything else I completely agree on.RecordListDownloadController.php:200ReplyI was thinking this would be included in `request`, but you're right, for convenience this would be good to have.RecordListDownloadPreset.php:26ReplyThe later processing of selected columns is all based on strings... so that would IMO warrant a pre-patch but also possibly break some things. Or would it be okay for you to make the getter return the imploded array then? Also it would require first splitting up the whole typoscript notation into an array too when fromArray() is called...?RecordListDownloadPreset.php:48ReplyThe "label" here is only "label of the preset". The column labels are assigned at another place later on.RecordListDownloadPreset.php:82ReplyI didn't find places in the TYPO3 core making use of "instanceof" (outside Tests), it's all "is_a" everywhere, still change this?RecordDownloadSettings.html:57ReplyI see your point, and I thought a bit about this too. You found the easter egg. ;-) What I often find hard is to make integrators aware of the possibility they have here. Without any kind of indicator, nobody will probably really learn to utilize that (let's face it, many integrators don't read changelogs...). Could we find some middle ground for this? A small icon/tooltip? An empty dropdown saing "no presets defined" or something like that? Anything that would hint people at "oh, here be dragons^W presets". -
Oli Bartsch commented on patch set 16 06/10/24, 17:23
RecordListDownloadPreset.php:26ReplyCould you show where we currently handle the columns as string? AFAICS do all usages in RecordListDownloadController and DownloadRecordList use the `columnsToRender` as array of column names.RecordListDownloadPreset.php:43This should only take one "preset" and return itself. Creating multiple DownloadPreset instances should be done by the calling code by iterating over such array an call formArray() for each preset separately. Thats's how a factory method should work.RecordListDownloadPreset.php:48ReplyThe label is currently compared in the `getColumnsToRender()` method to get the currently selected preset: `if (($presetData['label'] ?? '') === $selectedPreset) {`. Additionally we need some kind of identifier to allow overwriting presets. Relying on the numeric array index is not reliable.RecordListDownloadPreset.php:75This should be done in the BeforeRecordDownloadPresetsAreDisplayedEvent. This should just be the value object.RecordListDownloadPreset.php:82ReplyActually I find both "variants". I would go with instanceof but would not force this.RecordDownloadSettings.html:57ReplyAs discussed in slack, please just remove this, integrators should read changelogs :) -
Garvin Hicking commented on patch set 16 06/10/24, 17:40
RecordListDownloadPreset.php:26ReplyYou are right, sorry; I misremembered this and confused it with some other area I was working on. So yes, let's go with consistent columns as array.RecordListDownloadPreset.php:82ReplyAll good then, if you found those I didn't look well enough. I find instanceof better readable but thought I would break convention. Let's go for instanceof.RecordDownloadSettings.html:57ReplyJust to state that here too, yes, I agree on the point of consistency here, it can be removed (may need acceptance test adaptation, unsure) -
Garvin Hicking uploaded patch set 17
CR -1V -106/11/24, 06:16Rename RecordListDownloadPreset to DownloadPreset -
core-ci voted on patch set 17 V -1 06/11/24, 06:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59109
-
Garvin Hicking uploaded patch set 18
V -106/11/24, 08:08Code review -
Garvin Hicking commented on patch set 16 06/11/24, 08:09
RecordListDownloadController.php:177ReplyDoneRecordListDownloadController.php:198ReplyTried to address this, can you check if that's suitable like that. Test needs to be added.RecordListDownloadController.php:200ReplyAdded now.DatabaseRecordList.php:493ReplyDoneDatabaseRecordList.php:497ReplyNote done yet, could you maybe address this? Maybe we could use the typoscript array notations (10, 20, 30...) to provide the identifier? Or a new subkey "identifier" next to "label" and "columns" would be needed, but then together with the 10/20/30... that would feel kind of bloaty in Typoscript definition?DatabaseRecordList.php:507ReplyHope this is addressed now with the constructor set+fromArray logic?RecordListDownloadPreset.php:22ReplyDoneRecordListDownloadPreset.php:24ReplyDoneRecordListDownloadPreset.php:26ReplyDoneRecordListDownloadPreset.php:43ReplyNeeds addressing, maybe you can help me here?RecordListDownloadPreset.php:48Reply(see note above about identifier/label, marking this as resolved for better overview)RecordListDownloadPreset.php:82ReplyDoneRecordDownloadSettings.html:53ReplyStill needs addressing; maybe sufficient to use <f:translate> here and let it fallback to a string?!RecordDownloadSettings.html:57ReplyDone -
Garvin Hicking updated the commit message in patch set 19 06/11/24, 08:10
commit message keeps popping up -
core-ci voted on patch set 18 V -1 06/11/24, 08:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59127
-
core-ci voted on patch set 19 V -1 06/11/24, 08:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59128
-
Garvin Hicking uploaded patch set 20
V -106/11/24, 08:52Use named arrays -
core-ci voted on patch set 20 V +1 06/11/24, 08:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59138
-
Oli Bartsch uploaded patch set 21
V +106/12/24, 13:42 -
Oli Bartsch uploaded patch set 22 06/12/24, 13:48
-
core-ci voted on patch set 21 V -1 06/12/24, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59332
-
core-ci voted on patch set 22 V -1 06/12/24, 13:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59333
-
Oli Bartsch uploaded patch set 23
V -106/12/24, 13:56 -
core-ci voted on patch set 23 V +1 06/12/24, 14:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59334
-
Oli Bartsch commented on patch set 23 CR +1 V +1 06/12/24, 14:12
Reply
DoneRecordListDownloadController.php:198ReplyDoneDatabaseRecordList.php:497ReplyDoneRecordListDownloadPreset.php:43ReplyDoneRecordListDownloadPreset.php:75ReplyDoneRecordDownloadSettings.html:53ReplyDone -
Garvin Hicking commented on patch set 23 06/12/24, 14:41
A huge thank you to you, Oliver. Now I grasp what you hinted at, and it is of course much cleaner. Tested the current version and works well for me. -
Garvin Hicking voted on patch set 23 CR +1 V +1 06/12/24, 14:53
-
Benni Mack voted on patch set 23 CR +2 V +2 06/13/24, 12:56
-
Benni Mack merged patch set 24 06/13/24, 12:56
DatabaseRecordList.php:474