Review main Merged

92330[BUGFIX] Fix --exclude option in impexp:export command

Dan Kleine - geb. Untenzu CR +2 V +2 Easy +3 −3 updated 01/31/26, 08:40

Commit message

The --exclude option in the impexp command expects an associative array
with "table:uid" as keys. Symfony console however passes an array
with numeric keys to the export loop, which then throws a type error
and aborts the command.

Convert the CLI input to the expected format to avoid this error.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Josua Vogel +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Josua Vogel +1
    • Dan Kleine - geb. Untenzu +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1316

  1. Dan Kleine - geb. Untenzu uploaded patch set 1 01/14/26, 14:17

  2. Dan Kleine - geb. Untenzu uploaded patch set 2 01/14/26, 14:21

  3. Dan Kleine - geb. Untenzu commented on patch set 2 01/14/26, 14:25

    Just added a test to the fix. Also added version 12 and 13 to the releases list, since the error happens here as well (I actually stumbled upon it during an upgrade). See issue #108630, the GUI is fine, the error only happens in the CLI. Example command: vendor/bin/typo3 impexp:export --type t3d_compressed --levels 4 --table _ALL --include-related _ALL --include-static sys_file_storage --exclude pages:203 --exclude pages:204 --exclude pages:205 --pid 192 STYLEGUIDE
  4. core-ci voted on patch set 2 V +1 01/14/26, 14:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93452

  5. core-ci voted on patch set 1 V -1 01/14/26, 14:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93451

  6. Dan Kleine - geb. Untenzu updated the commit message in patch set 3 V +1 01/15/26, 06:25

  7. core-ci voted on patch set 3 V +1 01/15/26, 06:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93498

  8. Dan Kleine - geb. Untenzu voted on patch set 3 V +1 01/29/26, 16:03

  9. Garvin Hicking commented on patch set 3 01/29/26, 16:12

    ExportCommandTest.php:84

    Can you please add a distinct test for this case, just to be sure that this does not break "single" array entry cases? So that we have two of them. Also I wonder, does this only affect '--exclude' and not the other attributes too?
  10. Dan Kleine - geb. Untenzu commented on patch set 3 01/29/26, 21:00

    ExportCommandTest.php:84 Reply

    Hey :) Thanks for your time. first question: it does not change the outcome, the excludeMap fails in both cases before the fix because it gets numeric keys (0 for one argument and 0 & 1 for two), not the expected values as key ('be_users:3' and . The number of arguments doesn't matter. Single argument (--exclude be_users:3) - Before: [0 => 'be_users:3'] - After: ['be_users:3' => 1] Two arguments (--exclude be_users:3 --exclude pages:5) - Before: [0 => 'be_users:3', 1 => 'pages:5'] - After: ['be_users:3' => 1, 'pages:5' => 1] The array_fill_keys function just switches the key/value setup for the excludeMap variable. None, one, or n entries have the same logic. We can also keep the single argument in the test therefore, since it does not change the outcome. But I thought this is a more realistic test with multiple values, thats all. Regarding your question about other atributes: No. By looking at the list of arguments "--record" and "--list" could also have this bug. But the following code does not work with they keys, but with the values of the array. Only the excludeMap logic in Export.php:391 tries to access the key and apply the explode function to it. Btw: See issue #108630, the GUI is fine, the error only happens in the CLI. Example command to test this patch: vendor/bin/typo3 impexp:export --type t3d_compressed --levels 4 --table _ALL --include-related _ALL --include-static sys_file_storage --exclude pages:203 --exclude pages:204 --exclude pages:205 --pid 192 STYLEGUIDE
  11. Garvin Hicking commented on patch set 3 CR +1 V +1 01/30/26, 07:35

    ExportCommandTest.php:84 Reply

    Thanks for the detailed explanation. I found another test (PagesAndTtContentTest.php) that performs a test with a single exclude, and now that I read your patch again I fully understand an extra test would be superflous. I just tested this, the `<excludeMap>` output in the XML is also the same with the patch than with the GUI, and I would argue that this is an important bugfix for 12.4 exports, so I agree with the backport request.
  12. Garvin Hicking commented on patch set 3 01/30/26, 07:52

    (backports are prepared and green; the v12 backport needed a slight massage)
  13. Josua Vogel voted on patch set 3 CR +1 V +1 01/30/26, 09:34

  14. Garvin Hicking commented on patch set 3 01/30/26, 14:09

    I'll merge this tomorrow if there are no objections
  15. Garvin Hicking voted on patch set 3 CR +2 V +2 01/31/26, 08:40

  16. Garvin Hicking merged patch set 4 01/31/26, 08:40