Issue Bug Closed

#108630TYPO3 impexp:export command throws error when using the exclude option

Dan Kleine (Untenzu) 01/14/26, 13:57 updated 03/31/26, 08:59

Description

In a recent project I did an export via CLI command with multiple exclude pages like this:

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
(ddev 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)

When I do this I get the following error in TYPO3 14:

> Uncaught TYPO3 Exception explode():
> Argument #2 ($string) must be of type string, int given
> thrown in file /var/www/html/vendor/typo3/cms-impexp/Classes/Export.php
> in line 413

Reason: The CLI command returns an indexed array [0 => “pages:123”]
but Export::getExcludePagesClause() expects an associative array [“pages:123” => 1]
(`$tableAndUid => $isExcluded`) to iterate over keys properly.

The `explode(‘:’, $tableAndUid)` call fails because `$tableAndUid` contains
the numeric array key (0, 1, 2…) instead of the expected string like “pages:123”.

The fix is to change the way exclude pages are processed in the ExportCommand.php file,
so that the array is built as associative array.
vendor/typo3/cms-impexp/Classes/Command/ExportCommand.php:183

// Old:
$this->export->setExcludeMap($input->getOption(‘exclude’));
// New:
$this->export->setExcludeMap(array_fill_keys($input->getOption(‘exclude’), 1));

Reviews 3

History 39

  1. Dan Kleine (Untenzu) commented <span data-processor="relativetime" data-value="2026-01-14T14:08:14+00:00" > 01/14/26, 14:08 </span>

    Got this error in TYPO3 12. Also exists in main.

  2. Dan Kleine (Untenzu) commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-01-31T08:45:10+00:00" > 01/31/26, 08:45 </span>

    Applied in changeset commit:eb66f2f3a91b2ab165b3d50eb92a3aa1b2b07e5b.