Review main Merged

57648[FEATURE] Add hooks for DatabaseRecordList CSV actions

Guido Schmechel CR +2 V +2 Normal +55 −1 updated 08/05/18, 11:47

Commit message

Now it is possible to customize the csv output
in the DatabaseRecordList with a hook.

The following two hooks were implemented:
- customizeCsvHeader for the header
- customizeCsvRow for a single row

Review

  • Code review CR +2
    • Jigal van Hemert +2
    • Anja Leichsenring +1
    • Łukasz Uznański +1
    • Jörg Bösche +1
  • Verified V +2
    • Jigal van Hemert +2
    • Anja Leichsenring +1
    • Łukasz Uznański +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1113

  1. Guido Schmechel uploaded patch set 1 07/21/18, 09:01

  2. TYPO3com voted on patch set 1 V +1 07/21/18, 09:09 Completed build in 07m 33s on Sat, 21 Jul, 11:09 AM Test Summary: 33448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25629

  3. Stephan Großberndt voted on patch set 1 CR +1 07/21/18, 09:24

  4. Jigal van Hemert commented on patch set 1 07/21/18, 14:17

    Thanks for the patch. In one of the hooks I left some comments to streamline the code a bit. The comments are valid for both hooks. Can you push a new patch?
    Since we have several types of hooks in the core it would be nice to have a code sample for developers who want to use this hook.

    DatabaseRecordList.php:1511

    To prevent notices about missing array keys perhaps it's better to use something like $hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][__CLASS__]['customizeCsvRow'] ?? []; if (!empty($hooks)) { foreach ($hooks as $hookFunction) {

    DatabaseRecordList.php:1513

    It's nicer for the hook code to have descriptive strings as array keys. $hookParameters['row'] instead of $hookParameters[0]

    DatabaseRecordList.php:1514

    If you pass $row as a reference in the array the hook function can modify the $row directly without this part having to assign it to the variable again.
  5. Guido Schmechel uploaded patch set 2 07/21/18, 18:14

  6. Guido Schmechel commented on patch set 2 07/21/18, 18:16

    Reply

    Is the call in the RST file sufficient? Or would you expect sample code in the RST? I think the commit message is okay, because there is the rst file.

    DatabaseRecordList.php:1511 Reply

    Done

    DatabaseRecordList.php:1513 Reply

    Done

    DatabaseRecordList.php:1514 Reply

    Done
  7. TYPO3com voted on patch set 2 V +1 07/21/18, 18:22 Completed build in 07m 42s on Sat, 21 Jul, 08:22 PM Test Summary: 33448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25635

  8. Jörg Bösche voted on patch set 2 CR +1 07/23/18, 07:55

  9. Jigal van Hemert commented on patch set 2 V +1 CR +1 07/24/18, 19:35

    Thanks for the modifications!
  10. Anja Leichsenring voted on patch set 2 V +1 CR +1 08/05/18, 09:13

  11. Łukasz Uznański voted on patch set 2 V +1 CR +1 08/05/18, 09:36

  12. Jigal van Hemert voted on patch set 2 V +2 CR +2 08/05/18, 11:47

  13. Jigal van Hemert merged patch set 3 08/05/18, 11:47