#108630TYPO3 impexp:export command throws error when using the exclude option
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
-
Dan Kleine (Untenzu) commented <span data-processor="relativetime" data-value="2026-01-14T14:08:14+00:00" > 01/14/26, 14:08 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 92330 status
NewUnder Review <span data-processor="relativetime" data-value="2026-01-14T14:17:04+00:00" > 01/14/26, 14:17 </span> -
Gerrit Code Review pushed patch set 2 for main to change 92330 <span data-processor="relativetime" data-value="2026-01-14T14:21:56+00:00" > 01/14/26, 14:21 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 92330 <span data-processor="relativetime" data-value="2026-01-15T06:25:33+00:00" > 01/15/26, 06:25 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 92582 <span data-processor="relativetime" data-value="2026-01-30T07:35:16+00:00" > 01/30/26, 07:35 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 92583 <span data-processor="relativetime" data-value="2026-01-30T07:35:28+00:00" > 01/30/26, 07:35 </span>
-
Gerrit Code Review pushed patch set 2 for 12.4 to change 92583 <span data-processor="relativetime" data-value="2026-01-30T07:44:31+00:00" > 01/30/26, 07:44 </span>
-
Dan Kleine (Untenzu) commented and changed status
Under ReviewResolved done0 %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.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T08:59:42+00:00" > 03/31/26, 08:59 </span>
Got this error in TYPO3 12. Also exists in main.