Review main Merged

50944[BUGFIX] Ensure correct field ordering in CSV export

Nicole Hummel CR +2 V +2 Easy +4 −1 updated 01/01/17, 09:26

Commit message

Due to patch https://review.typo3.org/48998/ the whole database record
is fetched from the database instead of only the visible fields. This
screws up the CSV export as this on relies of the field sorting of the
database row. This patch ensures a correct sorting of the row fields
before they are added to the CSV export.

Review

  • Code review CR +2
    • Jigal van Hemert +2
    • Philipp Gampe +1
  • Verified V +2
    • Jigal van Hemert +2
    • Philipp Gampe +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1618

  1. Nicole Hummel uploaded patch set 1 12/12/16, 22:01

  2. TYPO3com voted on patch set 1 V +1 12/12/16, 22:05 Completed build in 03m 58s on Mon, 12 Dec, 11:05 PM Test Summary: 54373 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5716

  3. Thomas Scheibitz voted on patch set 1 V +1 12/12/16, 22:05

  4. Marcus Schwemer voted on patch set 1 CR +1 V +1 12/13/16, 07:45

  5. Markus Klein commented on patch set 1 12/20/16, 10:24

    DatabaseRecordList.php:2168

    This is tough array magic. Please lets add some detailed comments why we do that.
  6. Oliver Hader commented on patch set 1 12/20/16, 10:47

    DatabaseRecordList.php:2167

    Isn't it enough to use the keys of $this->fieldArray as first parameter to define the sorting of the resulting record fields? Without testing, it seems that the following line in this patch is not required, right?
  7. Oliver Hader commented on patch set 1 12/20/16, 10:54

    DatabaseRecordList.php:2167 Reply

    Just like this: $rowReducedToSelectedColumns = array_intersect_key(array_flip($this->fieldArray), $rowReducedByControlFields);
  8. Nicole Hummel commented on patch set 1 12/20/16, 10:59

    DatabaseRecordList.php:2167 Reply

    fieldArray contains the control fields as well. There is no way to get out of control fields and do correct sorting in one step
  9. Nicole Hummel uploaded patch set 2 12/20/16, 11:05

  10. TYPO3com voted on patch set 2 V +1 12/20/16, 11:10 Completed build in 04m 12s on Tue, 20 Dec, 12:10 PM Test Summary: 54399 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5884

  11. Oliver Hader commented on patch set 1 12/20/16, 11:29

    DatabaseRecordList.php:2167 Reply

    Sure, but the control fields would not be intersecting with the database record, otherwise they are (valid) columns of the table schema.
  12. Nicole Hummel commented on patch set 1 12/20/16, 11:48

    DatabaseRecordList.php:2167 Reply

    This is the result of your statement above: array ( 'username' => 0, 'usergroup' => 3, 'email' => 4, 'disable' => 5, 'admin' => 6, ) as the fieldArray is flipped, it stores the numeric keys as values. So you need to assign the real database values to that array afterwards.
  13. Philipp Gampe commented on patch set 2 V -1 12/31/16, 13:55

    Skips all internal columns, even if they are selected: uid, pid, tstamp for example.
  14. Nicole Hummel commented on patch set 2 12/31/16, 14:18

    Hm, tested this with be users and got uid, pid, tstamp, crdate in the export. What have you tested?
  15. Philipp Gampe commented on patch set 2 CR +1 V +1 12/31/16, 14:19

    it was my fault, it works all like expected
  16. Jigal van Hemert voted on patch set 2 CR +2 V +2 01/01/17, 09:25

  17. Gerrit merged patch set 2 01/01/17, 09:26

  18. Jigal van Hemert commented on patch set 3 01/01/17, 09:26

    Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit 9f48267bfa411ee9b26d1465b8a8a3a0902f84fe